fix: Use get for conditionally available fields while setting missing values
- Due to custom field "supplier" and missing field "supplier_address", dot operator breaks - Make sure to use "get" instead of just dot operator if field is in some doctypes, not all
This commit is contained in:
parent
108d1045e6
commit
78b6b29a57
@ -70,9 +70,18 @@ class BuyingController(StockController, Subcontracting):
|
|||||||
|
|
||||||
# set contact and address details for supplier, if they are not mentioned
|
# set contact and address details for supplier, if they are not mentioned
|
||||||
if getattr(self, "supplier", None):
|
if getattr(self, "supplier", None):
|
||||||
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions,
|
self.update_if_missing(
|
||||||
doctype=self.doctype, company=self.company, party_address=self.supplier_address, shipping_address=self.get('shipping_address'),
|
get_party_details(
|
||||||
fetch_payment_terms_template= not self.get('ignore_default_payment_terms_template')))
|
self.supplier,
|
||||||
|
party_type="Supplier",
|
||||||
|
doctype=self.doctype,
|
||||||
|
company=self.company,
|
||||||
|
party_address=self.get("supplier_address"),
|
||||||
|
shipping_address=self.get('shipping_address'),
|
||||||
|
fetch_payment_terms_template= not self.get('ignore_default_payment_terms_template'),
|
||||||
|
ignore_permissions=self.flags.ignore_permissions
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
self.set_missing_item_details(for_validate)
|
self.set_missing_item_details(for_validate)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user