mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-02 06:29:54 +00:00
fix: party name not updating correctly
(cherry picked from commit 469bb0ba4e)
This commit is contained in:
@@ -124,7 +124,8 @@ frappe.ui.form.on("Opening Invoice Creation Tool", {
|
||||
invoice_type: function (frm) {
|
||||
$.each(frm.doc.invoices, (idx, row) => {
|
||||
row.party_type = frm.doc.invoice_type == "Sales" ? "Customer" : "Supplier";
|
||||
row.party = "";
|
||||
frappe.model.set_value(row.doctype, row.name, "party", "");
|
||||
frappe.model.set_value(row.doctype, row.name, "party_name", "");
|
||||
});
|
||||
frm.refresh_fields();
|
||||
},
|
||||
|
||||
@@ -108,11 +108,10 @@ class OpeningInvoiceCreationTool(Document):
|
||||
frappe.throw(_("Row #{}: Either Party ID or Party Name is required").format(row.idx))
|
||||
|
||||
if not row.party and row.party_name:
|
||||
self.add_party(row.party_type, row.party_name)
|
||||
row.party = row.party_name
|
||||
row.party = self.add_party(row.party_type, row.party_name)
|
||||
|
||||
if row.party and not frappe.db.exists(row.party_type, row.party):
|
||||
self.add_party(row.party_type, row.party)
|
||||
row.party = self.add_party(row.party_type, row.party)
|
||||
|
||||
else:
|
||||
if not row.party:
|
||||
@@ -171,6 +170,7 @@ class OpeningInvoiceCreationTool(Document):
|
||||
|
||||
party_doc.flags.ignore_mandatory = True
|
||||
party_doc.save(ignore_permissions=True)
|
||||
return party_doc.name
|
||||
|
||||
def get_invoice_dict(self, row=None):
|
||||
def get_item_dict():
|
||||
|
||||
Reference in New Issue
Block a user