mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 13:41:47 +00:00
fix: guard against missing is_your_company_address custom field on address
(cherry picked from commit ea3ed8b836)
This commit is contained in:
@@ -15,7 +15,7 @@ class ERPNextAddress(Address):
|
|||||||
|
|
||||||
def link_address(self):
|
def link_address(self):
|
||||||
"""Link address based on owner"""
|
"""Link address based on owner"""
|
||||||
if self.is_your_company_address:
|
if self.get("is_your_company_address"):
|
||||||
return
|
return
|
||||||
|
|
||||||
return super().link_address()
|
return super().link_address()
|
||||||
@@ -26,7 +26,9 @@ class ERPNextAddress(Address):
|
|||||||
self.is_your_company_address = 1
|
self.is_your_company_address = 1
|
||||||
|
|
||||||
def validate_reference(self):
|
def validate_reference(self):
|
||||||
if self.is_your_company_address and not [row for row in self.links if row.link_doctype == "Company"]:
|
if self.get("is_your_company_address") and not [
|
||||||
|
row for row in self.links if row.link_doctype == "Company"
|
||||||
|
]:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_(
|
_(
|
||||||
"Address needs to be linked to a Company. Please add a row for Company in the Links table."
|
"Address needs to be linked to a Company. Please add a row for Company in the Links table."
|
||||||
|
|||||||
Reference in New Issue
Block a user