Skip to content

Commit

Permalink
fix: Reset represents company on disabling internal customer and supp…
Browse files Browse the repository at this point in the history
…lier (frappe#31302)
  • Loading branch information
deepeshgarg007 committed Jun 9, 2022
1 parent 2675751 commit c13e5ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/buying/doctype/supplier/supplier.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def get_supplier_group_details(self):
self.save()

def validate_internal_supplier(self):
if not self.is_internal_supplier:
self.represents_company = ""

internal_supplier = frappe.db.get_value(
"Supplier",
{
Expand Down
3 changes: 3 additions & 0 deletions erpnext/selling/doctype/customer/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def validate_default_bank_account(self):
)

def validate_internal_customer(self):
if not self.is_internal_customer:
self.represents_company = ""

internal_customer = frappe.db.get_value(
"Customer",
{
Expand Down

0 comments on commit c13e5ad

Please sign in to comment.