I’m trying name my table fields by scripting, I tried do this by erpnext interface but not works at all…
Tried do with append too, but this require the anothers values of table and i think that’s not the best way to do this…
Follow the ideia:
Table picture:
JS:
frappe.ui.form.on("Purchase Invoice", "after_save", function(frm) {
$.each(frm.doc.parcelas || [], function(i, d) {
//Naming parcelas
frappe.call({
method: "financeiro.financeiro.doctype.titulos.titulos.naming_parcelas",
args: {
doc_nome: frm.doc.name,
},
callback: function(r){}
});
});
});
PY:
@frappe.whitelist()
def naming_parcelas(doc_nome):
purchase_invoice = frappe.get_doc("Purchase Invoice", doc_nome)
purchase_invoice.parcelas[
'naming_series' = 'PARC-'
]
purchase_invoice.save()
return