Updated Addess py file
This commit is contained in:
parent
888c1f9bd4
commit
bd4c7c533c
@ -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}):
|
||||
|
Loading…
x
Reference in New Issue
Block a user