From 7135a75e5e28a5329b709174688761f78c307dff Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 3 Jun 2020 21:51:21 +0530 Subject: [PATCH 1/3] fix: Error when no data is present in AR/AP reeport --- .../report/accounts_receivable/accounts_receivable.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index d40e58b528..66aa18058b 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -169,9 +169,11 @@ class ReceivablePayableReport(object): def append_subtotal_row(self, party): sub_total_row = self.total_row_map.get(party) - self.data.append(sub_total_row) - self.data.append({}) - self.update_sub_total_row(sub_total_row, 'Total') + + if sub_total_row: + self.data.append(sub_total_row) + self.data.append({}) + self.update_sub_total_row(sub_total_row, 'Total') def get_voucher_balance(self, gle): if self.filters.get("sales_person"): @@ -232,7 +234,8 @@ class ReceivablePayableReport(object): if self.filters.get('group_by_party'): self.append_subtotal_row(self.previous_party) - self.data.append(self.total_row_map.get('Total')) + if self.data: + self.data.append(self.total_row_map.get('Total')) def append_row(self, row): self.allocate_future_payments(row) From 60c18550148ee7fe4972113eb5e1d3899fa839e1 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 4 Jun 2020 14:28:34 +0530 Subject: [PATCH 2/3] fix: import supplier invoice not working --- .../doctype/import_supplier_invoice/import_supplier_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py index 6b9567c0e5..31a7545a0d 100644 --- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py +++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py @@ -64,7 +64,8 @@ class ImportSupplierInvoice(Document): "buying_price_list": self.default_buying_price_list } - if not invoices_args.get("invoice_no", ''): return + if not invoices_args.get("bill_no", ''): + frappe.throw(_("Numero has not set in the XML file")) supp_dict = get_supplier_details(file_content) invoices_args["destination_code"] = get_destination_code_from_file(file_content) From 404ed88c0ca34aae06cb6e7b91a8442ec494440b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 4 Jun 2020 14:46:50 +0530 Subject: [PATCH 3/3] fix: routing operations not added sequentially in the BOM --- erpnext/manufacturing/doctype/bom/bom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 3253a496ed..2543eec53e 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -112,13 +112,14 @@ class BOM(WebsiteGenerator): if self.routing: self.set("operations", []) for d in frappe.get_all("BOM Operation", fields = ["*"], - filters = {'parenttype': 'Routing', 'parent': self.routing}): + filters = {'parenttype': 'Routing', 'parent': self.routing}, order_by="idx"): child = self.append('operations', { "operation": d.operation, "workstation": d.workstation, "description": d.description, "time_in_mins": d.time_in_mins, - "batch_size": d.batch_size + "batch_size": d.batch_size, + "idx": d.idx }) child.hour_rate = flt(d.hour_rate / self.conversion_rate, 2)