From eba9ca4d667b826668dbe2cd72d0e30c99f94ed8 Mon Sep 17 00:00:00 2001 From: shreyas Date: Tue, 26 Jan 2016 14:56:52 +0530 Subject: [PATCH] [Minor]Change to maintain args ordering convention --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 2 +- erpnext/accounts/party.py | 2 +- erpnext/controllers/accounts_controller.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 34c87d5c90..b8446531f0 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -96,7 +96,7 @@ class GLEntry(Document): frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company)) def validate_party(self): - validate_party_frozen_disabled(self.party, self.party_type) + validate_party_frozen_disabled(self.party_type, self.party) def validate_currency(self): company_currency = get_company_currency(self.company) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 60eb770076..29ed02d47c 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -309,7 +309,7 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup return get_tax_template(posting_date, args) -def validate_party_frozen_disabled(party_name, party_type): +def validate_party_frozen_disabled(party_type, party_name): if party_type and party_name: party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True) if party.disabled: diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index d6eff1cd57..81e5f9e1da 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -417,15 +417,15 @@ class AccountsController(TransactionBase): def validate_party(self): party_type, party = self.get_party() - validate_party_frozen_disabled(party, party_type) + validate_party_frozen_disabled(party_type, party) def get_party(self): party_type = None if self.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"): - party_type = 'Customer' + party_type = 'Customer' elif self.doctype in ("Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"): - party_type = 'Supplier' + party_type = 'Supplier' elif self.meta.get_field("customer"): party_type = "Customer"