From 8d72b147763394b7bffd8a266a667a6302b6d551 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 9 Mar 2020 08:06:07 +0530 Subject: [PATCH 1/5] fix: Acccounting Dimension disappearing in first row after refresh --- erpnext/public/js/utils/dimension_tree_filter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index 7abe4a7aab..8b6de0f517 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -35,11 +35,13 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { } } - if (frm.doc.items && frm.doc.items.length) { + if (frm.doc.items && frm.doc.items.length && frm.doc.docstatus === 0 + && (!frm.doc.items[0][dimension['fieldname']])) { frm.doc.items[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']]; } - if (frm.doc.accounts && frm.doc.accounts.length) { + if (frm.doc.accounts && frm.doc.accounts.length && frm.doc.docstatus === 0 + && (!frm.doc.items[0][dimension['fieldname']])) { frm.doc.accounts[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']]; } } From 4528badfcfd843d5d1a6863e62136bfda80c2413 Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 9 Mar 2020 18:07:43 +0530 Subject: [PATCH 2/5] fix: ModuleNotFoundError on Turkey Company setup (#20853) --- erpnext/regional/turkey/setup.py | 4 ++++ erpnext/setup/doctype/company/company.py | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 erpnext/regional/turkey/setup.py diff --git a/erpnext/regional/turkey/setup.py b/erpnext/regional/turkey/setup.py new file mode 100644 index 0000000000..ebf3b2bee1 --- /dev/null +++ b/erpnext/regional/turkey/setup.py @@ -0,0 +1,4 @@ +from __future__ import unicode_literals + +def setup(company=None, patch=True): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 6aa2c04671..956deef928 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -424,8 +424,13 @@ def install_country_fixtures(company): company_doc = frappe.get_doc("Company", company) path = frappe.get_app_path('erpnext', 'regional', frappe.scrub(company_doc.country)) if os.path.exists(path.encode("utf-8")): - frappe.get_attr("erpnext.regional.{0}.setup.setup" - .format(frappe.scrub(company_doc.country)))(company_doc, False) + try: + module_name = "erpnext.regional.{0}.setup.setup".format(frappe.scrub(company_doc.country)) + frappe.get_attr(module_name)(company_doc, False) + except Exception as e: + frappe.log_error(str(e), frappe.get_traceback()) + frappe.throw(_("Failed to setup defaults for country {0}. Please contact support@erpnext.com").format(frappe.bold(company_doc.country))) + def update_company_current_month_sales(company): current_month_year = formatdate(today(), "MM-yyyy") From 508ad51d9cf2dd2875f99e1e07e4768d8a3a1036 Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 9 Mar 2020 18:13:41 +0530 Subject: [PATCH 3/5] fix: Validate Serial No/Batch No against unserialized Item in Stock Reconciliation (#20858) --- .../stock/doctype/stock_reconciliation/stock_reconciliation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index ca2741ccfb..afa239466b 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -190,6 +190,9 @@ class StockReconciliation(StockController): has_serial_no = True self.get_sle_for_serialized_items(row, sl_entries) else: + if row.serial_no or row.batch_no: + frappe.throw(_("Row #{0}: Item {1} is not a Serialized/Batched Item. It cannot have a Serial No/Batch No against it.") \ + .format(row.idx, frappe.bold(row.item_code))) previous_sle = get_previous_sle({ "item_code": row.item_code, "warehouse": row.warehouse, From f866ed9679998aa29cdc95435daa446f8b24b16b Mon Sep 17 00:00:00 2001 From: Saqib Date: Mon, 9 Mar 2020 18:30:47 +0530 Subject: [PATCH 4/5] fix: [pos] customer group filter resets on syncing offline invoices (#20873) --- erpnext/accounts/doctype/sales_invoice/pos.py | 9 ++++++--- erpnext/accounts/page/pos/pos.js | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 749816f781..c0e128567f 100755 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -207,7 +207,7 @@ def get_customers_list(pos_profile={}): if pos_profile.get('customer_groups'): # Get customers based on the customer groups defined in the POS profile for d in pos_profile.get('customer_groups'): - customer_groups.extend([d.name for d in get_child_nodes('Customer Group', d.customer_group)]) + customer_groups.extend([d.get('name') for d in get_child_nodes('Customer Group', d.get('customer_group'))]) cond = "customer_group in (%s)" % (', '.join(['%s'] * len(customer_groups))) return frappe.db.sql(""" select name, customer_name, customer_group, @@ -387,7 +387,9 @@ def get_pricing_rule_data(doc): @frappe.whitelist() -def make_invoice(doc_list={}, email_queue_list={}, customers_list={}): +def make_invoice(pos_profile, doc_list={}, email_queue_list={}, customers_list={}): + import json + if isinstance(doc_list, string_types): doc_list = json.loads(doc_list) @@ -421,7 +423,8 @@ def make_invoice(doc_list={}, email_queue_list={}, customers_list={}): name_list.append(name) email_queue = make_email_queue(email_queue_list) - customers = get_customers_list() + pos_profile = json.loads(pos_profile) + customers = get_customers_list(pos_profile) return { 'invoice': name_list, 'email_queue': email_queue, diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 8dc00f3f21..24fcb41a5d 100755 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1769,6 +1769,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice", freeze: true, args: { + pos_profile: me.pos_profile_data, doc_list: me.si_docs, email_queue_list: me.email_queue_list, customers_list: me.customers_list From 5e58666091d99c6959ea5f8a03456b0a00ea8af5 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 9 Mar 2020 22:38:41 +0530 Subject: [PATCH 5/5] fix: HSN code not visible in GST Itemised Purchase register --- .../item_wise_purchase_register.py | 4 ++-- .../gst_itemised_purchase_register.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 4523f66deb..11f4e0d4e8 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -54,8 +54,8 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum 'description': d.description, 'invoice': d.parent, 'posting_date': d.posting_date, - 'customer': d.supplier, - 'customer_name': d.supplier_name + 'supplier': d.supplier, + 'supplier_name': d.supplier_name } if additional_query_columns: diff --git a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py index 3ce2547b20..b5948f9952 100644 --- a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py +++ b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py @@ -13,9 +13,9 @@ def execute(filters=None): dict(fieldtype='Data', label='GST Category', fieldname="gst_category", width=120), dict(fieldtype='Data', label='Export Type', fieldname="export_type", width=120), dict(fieldtype='Data', label='E-Commerce GSTIN', fieldname="ecommerce_gstin", width=130), - dict(fieldtype='Data', label='HSN Code', fieldname="hsn_code", width=120), - dict(fieldtype='Data', label='Supplier Invoice No', fieldname="supplier_invoice_no", width=120), - dict(fieldtype='Date', label='Supplier Invoice Date', fieldname="supplier_invoice_date", width=100) + dict(fieldtype='Data', label='HSN Code', fieldname="gst_hsn_code", width=120), + dict(fieldtype='Data', label='Supplier Invoice No', fieldname="bill_no", width=120), + dict(fieldtype='Date', label='Supplier Invoice Date', fieldname="bill_date", width=100) ], additional_query_columns=[ 'supplier_gstin', 'company_gstin',