[Minor]Change to maintain args ordering convention

This commit is contained in:
shreyas 2016-01-26 14:56:52 +05:30 committed by Anand Doshi
parent 79872bf62c
commit eba9ca4d66
3 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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