From ec421df4e490bec78018a720b2dc7489a8a62724 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 29 Jul 2019 08:58:56 +0530 Subject: [PATCH] fix: Code cleanup --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 4 ++-- erpnext/accounts/doctype/subscription/subscription.py | 3 --- erpnext/public/js/utils/dimension_tree_filter.js | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 4944c8f76f..078e05816d 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -90,13 +90,13 @@ class GLEntry(Document): if account_type == "Profit and Loss" \ and self.company == dimension.company and dimension.mandatory_for_pl and not dimension.disabled: - if not self.get(frappe.scrub(dimension.fieldname)): + if not self.get(dimension.fieldname): frappe.throw(_("Accounting Dimension {0} is required for 'Profit and Loss' account {1}.") .format(dimension.label, self.account)) if account_type == "Balance Sheet" \ and self.company == dimension.company and dimension.mandatory_for_bs and not dimension.disabled: - if not self.get(frappe.scrub(dimension.fieldname)): + if not self.get(dimension.fieldname): frappe.throw(_("Accounting Dimension {0} is required for 'Balance Sheet' account {1}.") .format(dimension.label, self.account)) diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index 6d01897e8f..f13ca4c49e 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -290,9 +290,6 @@ class Subscription(Document): invoice.save() invoice.submit() - for dimension in accounting_dimensions: - invoice.load_from_db() - return invoice def get_items_from_plans(self, plans, prorate=0): diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index 10855ea3e6..f1c92091a8 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -5,7 +5,8 @@ erpnext.doctypes_with_dimensions = ["GL Entry", "Sales Invoice", "Purchase Invoi "Purchase Order Item", "Journal Entry Account", "Material Request Item", "Delivery Note Item", "Purchase Receipt Item", "Stock Entry Detail", "Payment Entry Deduction", "Sales Taxes and Charges", "Purchase Taxes and Charges", "Shipping Rule", "Landed Cost Item", "Asset Value Adjustment", "Loyalty Program", "Fee Schedule", "Fee Structure", "Stock Reconciliation", - "Travel Request", "Fees", "POS Profile", "Opening Invoice Creation Tool", "Opening Invoice Creation Tool Item"]; + "Travel Request", "Fees", "POS Profile", "Opening Invoice Creation Tool", "Opening Invoice Creation Tool Item", "Subscription", + "Subscription Plan"]; frappe.call({ method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimension_filters",