From 4b9f20edb3ad2f3a52b56494126e5caeb926f050 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 23 Aug 2018 16:24:46 +0530 Subject: [PATCH 1/4] Permissions issue in BOM tree --- erpnext/manufacturing/doctype/bom/bom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index e5a62f27047..e2e920954ba 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -632,7 +632,10 @@ def get_children(doctype, parent=None, is_root=False, **filters): return if frappe.form_dict.parent: - bom_items = frappe.get_list('BOM Item', + bom_doc = frappe.get_doc("BOM", frappe.form_dict.parent) + frappe.has_permission("BOM", doc=bom_doc, throw=True) + + bom_items = frappe.get_all('BOM Item', fields=['item_code', 'bom_no as value', 'stock_qty'], filters=[['parent', '=', frappe.form_dict.parent]], order_by='idx') From 0754ece288d7c7c0d60a34ef8534a911d6547ba0 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 3 Sep 2018 10:44:40 +0530 Subject: [PATCH 2/4] Patch fixes (#15295) * patch fixes * [Fix] disable shopify if any exception occured while --- .../v10_0/added_extra_gst_custom_field.py | 3 +++ .../patches/v11_0/refactor_erpnext_shopify.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/erpnext/patches/v10_0/added_extra_gst_custom_field.py b/erpnext/patches/v10_0/added_extra_gst_custom_field.py index 98b18202fe5..000e8fd638b 100644 --- a/erpnext/patches/v10_0/added_extra_gst_custom_field.py +++ b/erpnext/patches/v10_0/added_extra_gst_custom_field.py @@ -6,4 +6,7 @@ def execute(): if not company: return + frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration") + frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission") + make_custom_fields(update=False) \ No newline at end of file diff --git a/erpnext/patches/v11_0/refactor_erpnext_shopify.py b/erpnext/patches/v11_0/refactor_erpnext_shopify.py index d31afe5550d..68a37d5fd8d 100644 --- a/erpnext/patches/v11_0/refactor_erpnext_shopify.py +++ b/erpnext/patches/v11_0/refactor_erpnext_shopify.py @@ -21,9 +21,13 @@ def execute(): setup_app_type() def setup_app_type(): - shopify_settings = frappe.get_doc("Shopify Settings") - shopify_settings.app_type = 'Private' - shopify_settings.update_price_in_erpnext_price_list = 0 if getattr(shopify_settings, 'push_prices_to_shopify', None) else 1 - shopify_settings.flags.ignore_mandatory = True - shopify_settings.ignore_permissions = True - shopify_settings.save() + try: + shopify_settings = frappe.get_doc("Shopify Settings") + shopify_settings.app_type = 'Private' + shopify_settings.update_price_in_erpnext_price_list = 0 if getattr(shopify_settings, 'push_prices_to_shopify', None) else 1 + shopify_settings.flags.ignore_mandatory = True + shopify_settings.ignore_permissions = True + shopify_settings.save() + except Exception: + frappe.db.set_value("Shopify Shopify", None, "enable_shopify", 0) + frappe.log_error(frappe.get_traceback()) \ No newline at end of file From 7b38d93e034f75525e879fc687912fe1400739fa Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 3 Sep 2018 16:06:22 +0530 Subject: [PATCH 3/4] [fix] setup lang in patch --- .../v11_0/create_department_records_for_each_company.py | 4 ++++ erpnext/patches/v11_0/update_department_lft_rgt.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index da97476fd35..c03cf989a23 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -3,6 +3,8 @@ from frappe import _ from frappe.utils.nestedset import rebuild_tree def execute(): + frappe.local.lang = frappe.db.get_default("lang") or 'en' + for doctype in ['department', 'leave_period', 'staffing_plan', 'job_opening', 'payroll_entry']: frappe.reload_doc("hr", "doctype", doctype) @@ -37,6 +39,8 @@ def execute(): update_instructors(comp_dict) + frappe.local.lang = 'en' + def update_records(doctype, comp_dict): when_then = [] for company in comp_dict: diff --git a/erpnext/patches/v11_0/update_department_lft_rgt.py b/erpnext/patches/v11_0/update_department_lft_rgt.py index 0cb9aeca4f0..5a8837ee2c3 100644 --- a/erpnext/patches/v11_0/update_department_lft_rgt.py +++ b/erpnext/patches/v11_0/update_department_lft_rgt.py @@ -10,7 +10,7 @@ def execute(): 'doctype': 'Department', 'department_name': _('All Departments'), 'is_group': 1 - }).insert(ignore_permissions=True) + }).insert(ignore_permissions=True, ignore_mandatory=True) frappe.db.sql("""update `tabDepartment` set parent_department = '{0}' where is_group = 0""".format(_('All Departments'))) From 3cea3c46b6ecf9d0dc47ac97e1f973745d71a8bc Mon Sep 17 00:00:00 2001 From: Zarrar Date: Wed, 5 Sep 2018 11:41:54 +0530 Subject: [PATCH 4/4] change modified date of account to reload fields (#15317) --- erpnext/accounts/doctype/account/account.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json index 5bb55ec2ca5..5a0be5e3758 100644 --- a/erpnext/accounts/doctype/account/account.json +++ b/erpnext/accounts/doctype/account/account.json @@ -625,7 +625,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-07-08 09:47:04.287841", + "modified": "2018-09-05 09:47:04.287841", "modified_by": "Administrator", "module": "Accounts", "name": "Account",