diff --git a/erpnext/regional/doctype/fec_import_document/fec_import_document.py b/erpnext/regional/doctype/fec_import_document/fec_import_document.py index 70bc6511751862f78cd10735d8d6c93854c25dee..a6b2a0932a90641acb19296a4504b45196051e3a 100644 --- a/erpnext/regional/doctype/fec_import_document/fec_import_document.py +++ b/erpnext/regional/doctype/fec_import_document/fec_import_document.py @@ -144,10 +144,10 @@ class FECImportDocument(Document): if account_type in ["Receivable", "Payable"] and not (compte_aux and compte_aux_type): if account_type == "Receivable": compte_aux_type = "Customer" - compte_aux = self.create_customer(compte_aux, row.compauxlib) + compte_aux = self.create_customer(row.compauxnum, row.compauxlib) else: compte_aux_type = "Supplier" - compte_aux = self.create_supplier(compte_aux, row.compauxlib) + compte_aux = self.create_supplier(row.compauxnum, row.compauxlib) row.party_type = compte_aux_type row.party = compte_aux @@ -429,15 +429,10 @@ class FECImportDocument(Document): if purchase_invoice.supplier and purchase_invoice.items: # self.purchase_invoices.append(purchase_invoice) try: - if self.pieceref: - purchase_invoice.name = self.pieceref - purchase_invoice.flags.draft_name_set = True + purchase_invoice.bill_no = self.pieceref purchase_invoice.insert() if frappe.db.get_value("FEC Import Settings", self.settings, "submit_sales_invoices"): - if self.pieceref: - purchase_invoice.flags.name_set = True - purchase_invoice.flags.ignore_version = True purchase_invoice.submit()