fix: Reset represents company on disabling internal customer and supplier (backport #31302) (#31306)

fix: Reset represents company on disabling internal customer and supplier (#31302)

(cherry picked from commit c13e5ad741)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
mergify[bot]
2022-06-09 19:20:53 +05:30
committed by GitHub
parent 77e4755c1f
commit fb9b302ecf
2 changed files with 6 additions and 0 deletions

View File

@@ -84,6 +84,9 @@ class Supplier(TransactionBase):
self.save()
def validate_internal_supplier(self):
if not self.is_internal_supplier:
self.represents_company = ""
internal_supplier = frappe.db.get_value(
"Supplier",
{

View File

@@ -141,6 +141,9 @@ class Customer(TransactionBase):
)
def validate_internal_customer(self):
if not self.is_internal_customer:
self.represents_company = ""
internal_customer = frappe.db.get_value(
"Customer",
{