fix: Reset represents company on disabling internal customer and supplier (#31302)
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index 97d0ba0..43152e8 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -84,6 +84,9 @@
self.save()
def validate_internal_supplier(self):
+ if not self.is_internal_supplier:
+ self.represents_company = ""
+
internal_supplier = frappe.db.get_value(
"Supplier",
{
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 8889a5f..35e0b0d 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -141,6 +141,9 @@
)
def validate_internal_customer(self):
+ if not self.is_internal_customer:
+ self.represents_company = ""
+
internal_customer = frappe.db.get_value(
"Customer",
{