From 0851c94e9b7e95b688aa83ede37056597b4ade37 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 17 Jul 2019 20:34:50 +0530 Subject: [PATCH 1/2] fix: offline pos syncing issue for customer --- erpnext/accounts/doctype/sales_invoice/pos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 3e013f5d6b..e2f99d6ea3 100755 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -451,6 +451,10 @@ def make_customer_and_address(customers): def add_customer(data): + customer = data.get('full_name') or data.get('customer') + if frappe.db.exists("Customer", customer.strip()): + return customer.strip() + customer_doc = frappe.new_doc('Customer') customer_doc.customer_name = data.get('full_name') or data.get('customer') customer_doc.customer_pos_id = data.get('customer_pos_id') From 438efb40084d9502d8525893a8e77a00df0d3183 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 17 Jul 2019 21:20:05 +0530 Subject: [PATCH 2/2] fix: cost center not able to access --- erpnext/accounts/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index e41c74cac8..8f1dfbc26e 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -730,7 +730,6 @@ def get_children(doctype, parent, company, is_root=False): parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_') fields = [ 'name as value', - 'root_type', 'is_group as expandable' ] filters = [['docstatus', '<', 2]] @@ -738,11 +737,11 @@ def get_children(doctype, parent, company, is_root=False): filters.append(['ifnull(`{0}`,"")'.format(parent_fieldname), '=', '' if is_root else parent]) if is_root: - fields += ['report_type', 'account_currency'] if doctype == 'Account' else [] + fields += ['root_type', 'report_type', 'account_currency'] if doctype == 'Account' else [] filters.append(['company', '=', company]) else: - fields += ['account_currency'] if doctype == 'Account' else [] + fields += ['root_type', 'account_currency'] if doctype == 'Account' else [] fields += [parent_fieldname + ' as parent'] acc = frappe.get_list(doctype, fields=fields, filters=filters)