From 1bd886387b2afcf11b5917cf27edc936fda6699d Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 17 Nov 2022 11:58:05 +0530 Subject: [PATCH 1/2] chore: hardcode doctype --- erpnext/assets/doctype/location/location.py | 4 ++-- .../doctype/quality_procedure/quality_procedure.py | 2 +- erpnext/setup/doctype/company/company.py | 4 ++-- erpnext/setup/doctype/department/department.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/assets/doctype/location/location.py b/erpnext/assets/doctype/location/location.py index 0d87bb2bf4..5bff3dd8c9 100644 --- a/erpnext/assets/doctype/location/location.py +++ b/erpnext/assets/doctype/location/location.py @@ -200,11 +200,11 @@ def get_children(doctype, parent=None, location=None, is_root=False): name as value, is_group as expandable from - `tab{doctype}` comp + `tabLocation` comp where ifnull(parent_location, "")={parent} """.format( - doctype=doctype, parent=frappe.db.escape(parent) + parent=frappe.db.escape(parent) ), as_dict=1, ) diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py index 72f9e6d6e4..e8604080fb 100644 --- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py +++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py @@ -79,7 +79,7 @@ def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=Fa ] else: return frappe.get_all( - doctype, + "Quality Procedure", fields=["name as value", "is_group as expandable"], filters=dict(parent_quality_procedure=parent), order_by="name asc", diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 875f63da63..d6f2378094 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -689,11 +689,11 @@ def get_children(doctype, parent=None, company=None, is_root=False): name as value, is_group as expandable from - `tab{doctype}` comp + `tabCompany` comp where ifnull(parent_company, "")={parent} """.format( - doctype=doctype, parent=frappe.db.escape(parent) + parent=frappe.db.escape(parent) ), as_dict=1, ) diff --git a/erpnext/setup/doctype/department/department.py b/erpnext/setup/doctype/department/department.py index c4766ee6f8..1745178574 100644 --- a/erpnext/setup/doctype/department/department.py +++ b/erpnext/setup/doctype/department/department.py @@ -63,7 +63,7 @@ def get_children(doctype, parent=None, company=None, is_root=False): else: filters["parent_department"] = parent - return frappe.get_all(doctype, fields=fields, filters=filters, order_by="name") + return frappe.get_all("Department", fields=fields, filters=filters, order_by="name") @frappe.whitelist() From b03b568e6cc7bcab31e4c6a3fd98f17f0eb65c1f Mon Sep 17 00:00:00 2001 From: Ritwik Puri Date: Thu, 17 Nov 2022 11:59:42 +0530 Subject: [PATCH 2/2] chore(patch): remove reload_doc from post model sync update_exchange_rate_settings patch (#32994) [skip ci] --- erpnext/patches/v13_0/update_exchange_rate_settings.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/erpnext/patches/v13_0/update_exchange_rate_settings.py b/erpnext/patches/v13_0/update_exchange_rate_settings.py index ed11c627d9..746195f2e1 100644 --- a/erpnext/patches/v13_0/update_exchange_rate_settings.py +++ b/erpnext/patches/v13_0/update_exchange_rate_settings.py @@ -1,10 +1,5 @@ -import frappe - from erpnext.setup.install import setup_currency_exchange def execute(): - frappe.reload_doc("accounts", "doctype", "currency_exchange_settings_result") - frappe.reload_doc("accounts", "doctype", "currency_exchange_settings_details") - frappe.reload_doc("accounts", "doctype", "currency_exchange_settings") setup_currency_exchange()