set department name with company abbr
This commit is contained in:
parent
39668609ce
commit
9a8f5bd6c7
@ -3,7 +3,7 @@
|
|||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:department_name",
|
"autoname": "",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2013-02-05 11:48:26",
|
"creation": "2013-02-05 11:48:26",
|
||||||
"custom": 0,
|
"custom": 0,
|
||||||
@ -434,7 +434,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-04-18 12:02:42.572599",
|
"modified": "2018-05-11 12:18:18.839182",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Department",
|
"name": "Department",
|
||||||
|
@ -10,6 +10,10 @@ from frappe.model.document import Document
|
|||||||
class Department(NestedSet):
|
class Department(NestedSet):
|
||||||
nsm_parent_field = 'parent_department'
|
nsm_parent_field = 'parent_department'
|
||||||
|
|
||||||
|
def autoname(self):
|
||||||
|
abbr = frappe.db.get_value('Company', self.company, 'abbr')
|
||||||
|
self.name = '{0} - {1}'.format(self.department_name, abbr)
|
||||||
|
|
||||||
def update_nsm_model(self):
|
def update_nsm_model(self):
|
||||||
frappe.utils.nestedset.update_nsm(self)
|
frappe.utils.nestedset.update_nsm(self)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user