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
  • Loading branch information
deepeshgarg007 committed Jun 9, 2022
1 parent 25f9d58 commit 3a1ab91
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 3a1ab91

Please sign in to comment.