fix: Reset represents company on disabling internal customer and supplier (backport #31302) (#31306)
fix: Reset represents company on disabling internal customer and supplier (#31302)
(cherry picked from commit c13e5ad741)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
@@ -84,6 +84,9 @@ class Supplier(TransactionBase):
|
|||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def validate_internal_supplier(self):
|
def validate_internal_supplier(self):
|
||||||
|
if not self.is_internal_supplier:
|
||||||
|
self.represents_company = ""
|
||||||
|
|
||||||
internal_supplier = frappe.db.get_value(
|
internal_supplier = frappe.db.get_value(
|
||||||
"Supplier",
|
"Supplier",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ class Customer(TransactionBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_internal_customer(self):
|
def validate_internal_customer(self):
|
||||||
|
if not self.is_internal_customer:
|
||||||
|
self.represents_company = ""
|
||||||
|
|
||||||
internal_customer = frappe.db.get_value(
|
internal_customer = frappe.db.get_value(
|
||||||
"Customer",
|
"Customer",
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user