Healthcare Service Unit - added company abbr as suffix (#15590)
This commit is contained in:
parent
dc2bab2b72
commit
be6e426fe0
File diff suppressed because it is too large
Load Diff
@ -5,10 +5,19 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
import frappe
|
||||
|
||||
class HealthcareServiceUnit(NestedSet):
|
||||
nsm_parent_field = 'parent_healthcare_service_unit'
|
||||
|
||||
def autoname(self):
|
||||
if self.company:
|
||||
suffix = " - " + frappe.get_cached_value('Company', self.company, "abbr")
|
||||
if not self.healthcare_service_unit_name.endswith(suffix):
|
||||
self.name = self.healthcare_service_unit_name + suffix
|
||||
else:
|
||||
self.name = self.healthcare_service_unit_name
|
||||
|
||||
def on_update(self):
|
||||
super(HealthcareServiceUnit, self).on_update()
|
||||
self.validate_one_root()
|
||||
|
Loading…
x
Reference in New Issue
Block a user