fix: Code cleanup

This commit is contained in:
deepeshgarg007 2019-07-29 08:58:56 +05:30
parent d9f3ba5fda
commit f37fb82069
3 changed files with 4 additions and 6 deletions

View File

@ -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 <b>{0}</b> 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 <b>{0}</b> is required for 'Balance Sheet' account {1}.")
.format(dimension.label, self.account))

View File

@ -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):

View File

@ -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",