mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 23:22:52 +00:00
frappe/frappe#478 fixes
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user