fix: update linked Customer on Patient update only if Link Customer to Patient is enabled (#25921)
This commit is contained in:
parent
811f607c85
commit
f899b3a633
@ -33,13 +33,13 @@ class Patient(Document):
|
||||
self.reload() # self.notify_update()
|
||||
|
||||
def on_update(self):
|
||||
if frappe.db.get_single_value('Healthcare Settings', 'link_customer_to_patient'):
|
||||
if self.customer:
|
||||
customer = frappe.get_doc('Customer', self.customer)
|
||||
if self.customer_group:
|
||||
customer.customer_group = self.customer_group
|
||||
if self.territory:
|
||||
customer.territory = self.territory
|
||||
|
||||
customer.customer_name = self.patient_name
|
||||
customer.default_price_list = self.default_price_list
|
||||
customer.default_currency = self.default_currency
|
||||
@ -47,7 +47,6 @@ class Patient(Document):
|
||||
customer.ignore_mandatory = True
|
||||
customer.save(ignore_permissions=True)
|
||||
else:
|
||||
if frappe.db.get_single_value('Healthcare Settings', 'link_customer_to_patient'):
|
||||
create_customer(self)
|
||||
|
||||
def set_full_name(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user