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

This commit is contained in:
Deepesh Garg 2022-06-09 19:18:52 +05:30 committed by GitHub
parent 2675751d6c
commit c13e5ad741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",
{