From 1f048b24265aa271d34921a23aed113f36a93d0d Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 11 Jun 2015 16:24:31 +0530 Subject: [PATCH] Fixes in Activity Cost --- .../projects/doctype/activity_cost/activity_cost.js | 1 + .../projects/doctype/activity_cost/activity_cost.json | 11 ++++++----- .../projects/doctype/activity_cost/activity_cost.py | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 erpnext/projects/doctype/activity_cost/activity_cost.js diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.js b/erpnext/projects/doctype/activity_cost/activity_cost.js new file mode 100644 index 0000000000..ba10153e5c --- /dev/null +++ b/erpnext/projects/doctype/activity_cost/activity_cost.js @@ -0,0 +1 @@ +cur_frm.add_fetch('employee', 'employee_name', 'employee_name'); \ No newline at end of file diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.json b/erpnext/projects/doctype/activity_cost/activity_cost.json index 7f7720acbb..bdc147e5fb 100644 --- a/erpnext/projects/doctype/activity_cost/activity_cost.json +++ b/erpnext/projects/doctype/activity_cost/activity_cost.json @@ -2,7 +2,7 @@ "allow_copy": 0, "allow_import": 1, "allow_rename": 1, - "autoname": "Activity Cost - .#", + "autoname": "AC-.#####", "creation": "2015-03-23 02:00:21.861546", "custom": 0, "docstatus": 0, @@ -31,11 +31,12 @@ }, { "fieldname": "employee_name", - "fieldtype": "Read Only", + "fieldtype": "Data", "label": "Employee Name", - "options": "employee.employee_name", + "options": "", "permlevel": 0, - "precision": "" + "precision": "", + "read_only": 1 }, { "fieldname": "column_break_2", @@ -135,7 +136,7 @@ "is_submittable": 0, "issingle": 0, "istable": 0, - "modified": "2015-04-14 02:08:33.690406", + "modified": "2015-06-11 06:50:47.999788", "modified_by": "Administrator", "module": "Projects", "name": "Activity Cost", diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.py b/erpnext/projects/doctype/activity_cost/activity_cost.py index 121e6508f8..8cd04f564a 100644 --- a/erpnext/projects/doctype/activity_cost/activity_cost.py +++ b/erpnext/projects/doctype/activity_cost/activity_cost.py @@ -15,6 +15,8 @@ class ActivityCost(Document): self.check_unique() def set_title(self): + if not self.employee_name: + self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name") self.title = _("{0} for {1}").format(self.employee_name, self.activity_type) def check_unique(self):