Updated Addess py file

This commit is contained in:
Landry 2024-11-11 15:07:55 +00:00
parent 888c1f9bd4
commit bd4c7c533c

View File

@ -15,7 +15,7 @@ class ERPNextAddress(Address):
def link_address(self):
"""Link address based on owner"""
if self.is_your_company_address:
if self.custom_is_your_company_address:
return
return super(ERPNextAddress, self).link_address()
@ -23,10 +23,10 @@ class ERPNextAddress(Address):
def update_compnay_address(self):
for link in self.get("links"):
if link.link_doctype == "Company":
self.is_your_company_address = 1
self.custom_is_your_company_address = 1
def validate_reference(self):
if self.is_your_company_address and not [
if self.custom_is_your_company_address and not [
row for row in self.links if row.link_doctype == "Company"
]:
frappe.throw(
@ -50,7 +50,7 @@ def get_shipping_address(company, address=None):
filters = [
["Dynamic Link", "link_doctype", "=", "Company"],
["Dynamic Link", "link_name", "=", company],
["Address", "is_your_company_address", "=", 1],
["Address", "custom_is_your_company_address", "=", 1],
]
fields = ["*"]
if address and frappe.db.get_value("Dynamic Link", {"parent": address, "link_name": company}):