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 (backport #31302) (#31306)

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

(cherry picked from commit c13e5ad)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
  • Loading branch information
mergify[bot] and deepeshgarg007 authored Jun 9, 2022
1 parent 77e4755 commit fb9b302
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 fb9b302

Please sign in to comment.