From 94dd7ef8796dd4940658a96414e1926730ab007a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 12 Sep 2012 14:53:44 +0530 Subject: [PATCH 1/2] show employee name in employee link field in attendance form --- erpnext/hr/doctype/attendance/attendance.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/attendance/attendance.js b/erpnext/hr/doctype/attendance/attendance.js index 4ccc63ed9b..120a50e318 100644 --- a/erpnext/hr/doctype/attendance/attendance.js +++ b/erpnext/hr/doctype/attendance/attendance.js @@ -18,13 +18,13 @@ cur_frm.add_fetch('employee', 'company', 'company'); //get employee's name based on employee id selected cur_frm.cscript.employee = function(doc,cdt,cdn){ - if(doc.employee) get_server_fields('get_emp_name', '', '', doc, cdt, cdn, 1); - refresh_field('employee_name'); + if(doc.employee) get_server_fields('get_emp_name', '', '', doc, cdt, cdn, 1); + refresh_field('employee_name'); } //Employee //----------------------------- cur_frm.fields_dict['employee'].get_query = function(doc,cdt,cdn) { - return 'SELECT `tabEmployee`.`name` FROM `tabEmployee` WHERE `tabEmployee`.status = "Active" AND `tabEmployee`.`docstatus`!= 2 AND `tabEmployee`.%(key)s LIKE "%s" ORDER BY `tabEmployee`.`name` ASC LIMIT 50'; + return 'SELECT `tabEmployee`.`name`, `tabEmployee`.`employee_name` FROM `tabEmployee` WHERE `tabEmployee`.status = "Active" AND `tabEmployee`.`docstatus`!= 2 AND (`tabEmployee`.`employee_name` LIKE "%s" OR `tabEmployee`.`%(key)s` LIKE "%s") ORDER BY `tabEmployee`.`name` ASC LIMIT 50'; } From 6a6cf5e5739569969aba5d902c470b714871ee25 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 12 Sep 2012 15:26:56 +0530 Subject: [PATCH 2/2] parent account mandatory validation --- erpnext/accounts/doctype/account/account.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 335d47caa1..dfc138bcc1 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -79,6 +79,10 @@ class DocType: elif par and not self.doc.is_pl_account: self.doc.is_pl_account = par[0][2] self.doc.debit_or_credit = par[0][3] + elif self.doc.account_name not in ['Income','Source of Funds (Liabilities)',\ + 'Expenses','Application of Funds (Assets)']: + msgprint("Parent Account is mandatory", raise_exception=1) + # Account name must be unique # ==================================================================