This commit is contained in:
Nabin Hait
2014-04-03 17:38:54 +05:30
parent 99f914b782
commit 365ae27acf
17 changed files with 50 additions and 50 deletions

View File

@@ -25,13 +25,12 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
if not ignore_permissions and not frappe.has_permission(party_type, "read", party):
frappe.throw("Not Permitted", frappe.PermissionError)
party_doc = frappe.get_doc(party_type, party)
party = party_doc
party = frappe.get_doc(party_type, party)
set_address_details(out, party, party_type)
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, price_list)
set_price_list(out, party, party_type, price_list)
if not out.get("currency"):
out["currency"] = currency
@@ -41,7 +40,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
out["sales_team"] = [{
"sales_person": d.sales_person,
"sales_designation": d.sales_designation
} for d in party_doc.get("sales_team")]
} for d in party.get("sales_team")]
return out
@@ -81,7 +80,7 @@ def set_other_values(out, party, party_type):
if party.get("default_" + f):
out[f] = party.get("default_" + f)
def set_price_list(out, party, given_price_list):
def set_price_list(out, party, party_type, given_price_list):
# price list
price_list = get_restrictions().get("Price List")
if isinstance(price_list, list):
@@ -90,7 +89,7 @@ def set_price_list(out, party, given_price_list):
if not price_list:
price_list = party.default_price_list
if not price_list and party.party_type=="Customer":
if not price_list and party_type=="Customer":
price_list = frappe.db.get_value("Customer Group",
party.customer_group, "default_price_list")