From 740aceecc3d067644cefc86651c2a66833e89bc7 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Tue, 26 Apr 2011 17:38:26 +0530 Subject: [PATCH 1/9] [IMP] add help on code field of hr.salary.rule bzr revid: psi@tinyerp.co.in-20110426120826-3uid7tvyfwrj5fjt --- addons/hr_payroll/hr_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 6757b57c417..16189def579 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -638,7 +638,7 @@ class hr_salary_rule(osv.osv): _name = 'hr.salary.rule' _columns = { 'name':fields.char('Name', size=256, required=True, readonly=False), - 'code':fields.char('Code', size=64, required=True), + 'code':fields.char('Code', size=64, required=True, help="Code is case sensitive."), 'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'), 'category_id':fields.many2one('hr.salary.head', 'Salary Head', required=True), 'active':fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the salary rule without removing it."), From ac07145e5ac10eabd2fac907a06639539d1f422a Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 28 Apr 2011 12:01:40 +0530 Subject: [PATCH 2/9] [IMP] hr_payroll: added ir.rule for employee payslip and modified access rights bzr revid: mtr@mtr-20110428063140-rxao7nev4xgzl9f2 --- addons/hr_payroll/security/hr_security.xml | 7 +++++++ addons/hr_payroll/security/ir.model.access.csv | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/hr_payroll/security/hr_security.xml b/addons/hr_payroll/security/hr_security.xml index 339fb1961b9..3c2d84ea089 100644 --- a/addons/hr_payroll/security/hr_security.xml +++ b/addons/hr_payroll/security/hr_security.xml @@ -6,5 +6,12 @@ + + Employee Payslip + + [('employee_id.user_id','=',user.id)] + + + \ No newline at end of file diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv index 609fc99c034..d783db77455 100644 --- a/addons/hr_payroll/security/ir.model.access.csv +++ b/addons/hr_payroll/security/ir.model.access.csv @@ -1,10 +1,10 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1 -"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,1,1,1 -"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1 -"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1 -"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1 -"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",1,1,1,1 +"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,0,0,0 +"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,0,0,0 +"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,0,0,0 +"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,0,0,0 +"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,0,0,0 +"access_hr_payslip_input_user","hr.payslip.input.user","model_hr_payslip_input","base.group_hr_user",1,0,0,0 "access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1 "access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1 "access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1 From 43327d9e9b3e3b22559b787e8de16c5ebe1d17fb Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 28 Apr 2011 14:05:38 +0530 Subject: [PATCH 3/9] [IMP] hr_payroll: 'HR / Officer' can now see the payslips of him and of employess for which he's the manager bzr revid: mtr@mtr-20110428083538-v08g50zk6sx18t4j --- addons/hr_payroll/security/hr_security.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/security/hr_security.xml b/addons/hr_payroll/security/hr_security.xml index 3c2d84ea089..d55f1c81cce 100644 --- a/addons/hr_payroll/security/hr_security.xml +++ b/addons/hr_payroll/security/hr_security.xml @@ -9,7 +9,7 @@ Employee Payslip - [('employee_id.user_id','=',user.id)] + ['|', ('employee_id.user_id', '=', user.id), ('employee_id.department_id.manager_id.user_id', '=', user.id)] From 148b1d45a12789be61ea6e8a731defcaec0a1b7f Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 28 Apr 2011 14:23:11 +0530 Subject: [PATCH 4/9] [IMP] hr_payroll: revert back the changes of access rights,made for hr user bzr revid: mtr@mtr-20110428085311-7017lofdf8jf7s3f --- addons/hr_payroll/security/ir.model.access.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv index d783db77455..ba816ea94f8 100644 --- a/addons/hr_payroll/security/ir.model.access.csv +++ b/addons/hr_payroll/security/ir.model.access.csv @@ -1,10 +1,10 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,0,0,0 -"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,0,0,0 -"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,0,0,0 -"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,0,0,0 -"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,0,0,0 -"access_hr_payslip_input_user","hr.payslip.input.user","model_hr_payslip_input","base.group_hr_user",1,0,0,0 +"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1 +"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,1,1,1 +"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1 +"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1 +"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1 +"access_hr_payslip_input_user","hr.payslip.input.user","model_hr_payslip_input","base.group_hr_user",1,1,1,1 "access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1 "access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1 "access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1 From c44fef652682f9e33c96ad7eef91428a5a545218 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Thu, 28 Apr 2011 19:00:56 +0530 Subject: [PATCH 5/9] [IMP] improve the tooltip on code field of hr.salary.rule object bzr revid: psi@tinyerp.co.in-20110428133056-cramofq63y4s9nhy --- addons/hr_payroll/hr_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 16189def579..11c08db580f 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -638,7 +638,7 @@ class hr_salary_rule(osv.osv): _name = 'hr.salary.rule' _columns = { 'name':fields.char('Name', size=256, required=True, readonly=False), - 'code':fields.char('Code', size=64, required=True, help="Code is case sensitive."), + 'code':fields.char('Code', size=64, required=True, help="The code of salary rules can be used as reference in computation of other rules. In that case, it is case sensitive."), 'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'), 'category_id':fields.many2one('hr.salary.head', 'Salary Head', required=True), 'active':fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the salary rule without removing it."), From a13984cf7baf0b02f97a1d539f1c7eca94b7f41e Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Wed, 4 May 2011 16:43:48 +0530 Subject: [PATCH 6/9] [IMP] remove sequence form salary head object bzr revid: psi@tinyerp.co.in-20110504111348-kngj0i0tert4w9pt --- addons/hr_payroll/hr_payroll.py | 4 +--- addons/hr_payroll/hr_payroll_view.xml | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 132d8fc1104..a8b12327995 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -177,14 +177,12 @@ class hr_salary_head(osv.osv): 'parent_id':fields.many2one('hr.salary.head', 'Parent', help="Linking a salary head to its parent is used only for the reporting purpose."), 'note': fields.text('Description'), 'company_id':fields.many2one('res.company', 'Company', required=False), - 'sequence': fields.integer('Sequence', required=True, help='Display sequence order'), } _defaults = { 'company_id': lambda self, cr, uid, context: \ self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id, - 'sequence': 5 } hr_salary_head() @@ -218,7 +216,7 @@ class hr_payslip(osv.osv): cr.execute('''SELECT pl.slip_id, pl.id FROM hr_payslip_line AS pl \ LEFT JOIN hr_salary_head AS sh on (pl.category_id = sh.id) \ WHERE pl.slip_id in %s \ - GROUP BY pl.slip_id, sh.sequence, pl.sequence, pl.id ORDER BY sh.sequence, pl.sequence''',(tuple(ids),)) + GROUP BY pl.slip_id, pl.sequence, pl.id ORDER BY pl.sequence''',(tuple(ids),)) res = cr.fetchall() for r in res: result.setdefault(r[0], []) diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 40a52a6c74e..53f4eb8c6fb 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -186,8 +186,8 @@ - - + + @@ -249,18 +249,18 @@
- - - - - - + + + + + +
- + @@ -357,7 +357,6 @@ - @@ -373,7 +372,6 @@ - @@ -533,14 +531,14 @@ - + - + From 84739f218e893b52e13f5024fd80ac12aa49062d Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 10 May 2011 17:24:11 +0530 Subject: [PATCH 7/9] [IMP] hr_payroll: renamed salary head into salary category bzr revid: mtr@mtr-20110510115411-lkf923pyakj1ykug --- addons/hr_payroll/hr_payroll.py | 38 +++++++++---------- addons/hr_payroll/hr_payroll_data.xml | 16 ++++---- addons/hr_payroll/hr_payroll_view.xml | 36 +++++++++--------- .../hr_payroll/security/ir.model.access.csv | 2 +- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 132d8fc1104..e4597aa0c8d 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -164,17 +164,17 @@ class contrib_register(osv.osv): contrib_register() -class hr_salary_head(osv.osv): +class hr_salary_category(osv.osv): """ - HR Salary Head + HR Salary Category """ - _name = 'hr.salary.head' - _description = 'Salary Head' + _name = 'hr.salary.category' + _description = 'Salary Category' _columns = { 'name':fields.char('Name', size=64, required=True, readonly=False), 'code':fields.char('Code', size=64, required=True, readonly=False), - 'parent_id':fields.many2one('hr.salary.head', 'Parent', help="Linking a salary head to its parent is used only for the reporting purpose."), + 'parent_id':fields.many2one('hr.salary.category', 'Parent', help="Linking a salary category to its parent is used only for the reporting purpose."), 'note': fields.text('Description'), 'company_id':fields.many2one('res.company', 'Company', required=False), 'sequence': fields.integer('Sequence', required=True, help='Display sequence order'), @@ -187,7 +187,7 @@ class hr_salary_head(osv.osv): 'sequence': 5 } -hr_salary_head() +hr_salary_category() class one2many_mod2(fields.one2many): @@ -212,11 +212,11 @@ class hr_payslip(osv.osv): _name = 'hr.payslip' _description = 'Pay Slip' - def _get_lines_salary_head(self, cr, uid, ids, field_names, arg=None, context=None): + def _get_lines_salary_category(self, cr, uid, ids, field_names, arg=None, context=None): result = {} if not ids: return result cr.execute('''SELECT pl.slip_id, pl.id FROM hr_payslip_line AS pl \ - LEFT JOIN hr_salary_head AS sh on (pl.category_id = sh.id) \ + LEFT JOIN hr_salary_category AS sh on (pl.category_id = sh.id) \ WHERE pl.slip_id in %s \ GROUP BY pl.slip_id, sh.sequence, pl.sequence, pl.id ORDER BY sh.sequence, pl.sequence''',(tuple(ids),)) res = cr.fetchall() @@ -253,7 +253,7 @@ class hr_payslip(osv.osv): 'paid': fields.boolean('Made Payment Order ? ', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'note': fields.text('Description'), 'contract_id': fields.many2one('hr.contract', 'Contract', required=False, readonly=True, states={'draft': [('readonly', False)]}), - 'details_by_salary_head': fields.function(_get_lines_salary_head, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Head'), + 'details_by_salary_category': fields.function(_get_lines_salary_category, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Head'), 'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another"), } _defaults = { @@ -473,10 +473,10 @@ class hr_payslip(osv.osv): return res def get_payslip_lines(self, cr, uid, contract_ids, payslip_id, context): - def _sum_salary_head(localdict, head, amount): - if head.parent_id: - localdict = _sum_salary_head(localdict, head.parent_id, amount) - localdict['heads'][head.code] = head.code in localdict['heads'] and localdict['heads'][head.code] + amount or amount + def _sum_salary_category(localdict, category, amount): + if category.parent_id: + localdict = _sum_salary_category(localdict, category.parent_id, amount) + localdict['categories'][category.code] = category.code in localdict['categories'] and localdict['categories'][category.code] + amount or amount return localdict #we keep a dict with the result because a value can be overwritten by another rule with the same code @@ -487,7 +487,7 @@ class hr_payslip(osv.osv): worked_days = {} for input_line in payslip.input_line_ids: worked_days[input_line.code] = input_line - localdict = {'heads': {}, 'payslip': payslip, 'worked_days': worked_days} + localdict = {'categories': {}, 'payslip': payslip, 'worked_days': worked_days} #get the ids of the structures on the contracts and their parent id as well structure_ids = self.pool.get('hr.contract').get_all_structures(cr, uid, contract_ids, context=context) #get the rules of the structure and thier children @@ -510,7 +510,7 @@ class hr_payslip(osv.osv): #set/overwrite the amount computed for this rule in the localdict localdict[rule.code] = amount #sum the amount for its salary head - localdict = _sum_salary_head(localdict, rule.category_id, amount - previous_amount) + localdict = _sum_salary_category(localdict, rule.category_id, amount - previous_amount) #create/overwrite the rule in the temporary results result_dict[key] = { 'salary_rule_id': rule.id, @@ -644,7 +644,7 @@ class hr_salary_rule(osv.osv): 'code':fields.char('Code', size=64, required=True), 'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'), 'quantity': fields.char('Quantity', size=256, help="It is used in computation for percentage and fixed amount.For e.g. A rule for Meal Voucher having fixed amount of 1€ per worked day can have its quantity defined in expression like worked_days['WORK100']['number_of_days']."), - 'category_id':fields.many2one('hr.salary.head', 'Salary Head', required=True), + 'category_id':fields.many2one('hr.salary.category', 'Category', required=True), 'active':fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the salary rule without removing it."), 'appears_on_payslip': fields.boolean('Appears on Payslip', help="Used for the display of rule on payslip"), 'parent_rule_id':fields.many2one('hr.salary.rule', 'Parent Salary Rule', select=True), @@ -684,7 +684,7 @@ class hr_salary_rule(osv.osv): # employee: hr.employee object # contract: hr.contract object # rules: rules code (previously computed) -# heads: dictionary containing the computed heads (sum of amount of all rules belonging to that head). Keys are the head codes. +# categories: dictionary containing the computed categories (sum of amount of all rules belonging to that category). Keys are the category codes. # worked_days: dictionary containing the computed worked days. Keys are the worked days codes. # Note: returned value have to be set in the variable 'result' @@ -698,12 +698,12 @@ result = contract.wage * 0.10''', # employee: hr.employee object # contract: hr.contract object # rules: rules code (previously computed) -# heads: dictionary containing the computed heads (sum of amount of all rules belonging to that head). Keys are the head codes. +# categories: dictionary containing the computed categories (sum of amount of all rules belonging to that category). Keys are the category codes. # worked_days: dictionary containing the computed worked days. Keys are the worked days codes. # Note: returned value have to be set in the variable 'result' -result = rules['NET'] > heads['NET'] * 0.10''', +result = rules['NET'] > categories['NET'] * 0.10''', 'condition_range': 'contract.wage', 'sequence': 5, 'appears_on_payslip': True, diff --git a/addons/hr_payroll/hr_payroll_data.xml b/addons/hr_payroll/hr_payroll_data.xml index 21273bfa725..49253ca90b4 100644 --- a/addons/hr_payroll/hr_payroll_data.xml +++ b/addons/hr_payroll/hr_payroll_data.xml @@ -2,32 +2,32 @@ - + Basic BASIC - + Allowance ALW - + Deduction DED - + Gross GROSS - + Net NET - + Company Contribution COMP @@ -177,7 +177,7 @@ none code - result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) + result = categories['BASIC'] + ('ALW' in categories and categories['ALW'] or 0.0) @@ -187,7 +187,7 @@ none code - result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) + ('DED' in heads and heads['DED'] or 0.0) + result = categories['BASIC'] + ('ALW' in categories and categories['ALW'] or 0.0) + ('DED' in categories and categories['DED'] or 0.0) diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 40a52a6c74e..1f39afc2462 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -260,8 +260,8 @@ - - + + @@ -347,9 +347,9 @@ - - hr.salary.head.form - hr.salary.head + + hr.salary.category.form + hr.salary.category form
@@ -365,9 +365,9 @@ - - hr.salary.head.tree - hr.salary.head + + hr.salary.category.tree + hr.salary.category tree @@ -379,9 +379,9 @@ - - hr.salary.head.select - hr.salary.head + + hr.salary.category.select + hr.salary.category search @@ -391,16 +391,16 @@ - - Salary Heads - hr.salary.head + + Salary Categories + hr.salary.category form - - + + diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv index 609fc99c034..9fe2fd67498 100644 --- a/addons/hr_payroll/security/ir.model.access.csv +++ b/addons/hr_payroll/security/ir.model.access.csv @@ -1,7 +1,7 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1 "access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,1,1,1 -"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1 +"access_hr_salary_category","hr.salary.category","model_hr_salary_category","base.group_hr_user",1,1,1,1 "access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1 "access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1 "access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",1,1,1,1 From 7e28aed3a08f44e58fcf83005f5a29d7c616e2fd Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 10 May 2011 18:41:10 +0530 Subject: [PATCH 8/9] [FIX] Payroll: Payslip lines readonly with all states of payslips bzr revid: mra@mra-laptop-20110510131110-gd32dkedh7m3gv2i --- addons/hr_payroll/hr_payroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 132d8fc1104..6894f32ad5c 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -247,7 +247,7 @@ class hr_payslip(osv.osv): \n* If the salary is paid then state is set to \'Paid Salary\'.\ \n* The \'Reject\' state is used when user cancel payslip.'), # 'line_ids': fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}), - 'line_ids': one2many_mod2('hr.payslip.line', 'slip_id', 'Payslip Line',readonly=True, states={'draft':[('readonly',False)]}), + 'line_ids': one2many_mod2('hr.payslip.line', 'slip_id', 'Payslip Line',readonly=True), 'company_id': fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'input_line_ids': fields.one2many('hr.payslip.input', 'payslip_id', 'Payslip Inputs', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'paid': fields.boolean('Made Payment Order ? ', required=False, readonly=True, states={'draft': [('readonly', False)]}), From 3eb0031cae88eba3f2443f8f42198cbd8c2b47fc Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Tue, 10 May 2011 19:02:27 +0530 Subject: [PATCH 9/9] [IMP] improve searh view of hr.employee add filter on categories bzr revid: psi@tinyerp.co.in-20110510133227-fzbbptd2tje5suf8 --- addons/hr/hr.py | 6 +++--- addons/hr/hr_view.xml | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index a2c4ee3805b..13db46ccc22 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -142,8 +142,8 @@ class hr_employee(osv.osv): 'work_email': fields.char('Work E-mail', size=240), 'work_location': fields.char('Office Location', size=32), 'notes': fields.text('Notes'), - 'parent_id': fields.many2one('hr.employee', 'Manager'), - 'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel', 'emp_id', 'category_id', 'Category'), + 'parent_id': fields.many2one('hr.employee', 'Manager'), + 'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel', 'emp_id', 'category_id', 'Categories'), 'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'), 'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True), 'coach_id': fields.many2one('hr.employee', 'Coach'), @@ -231,7 +231,7 @@ class res_users(osv.osv): except: # Tolerate a missing shortcut. See product/product.py for similar code. logging.getLogger('orm').debug('Skipped meetings shortcut for user "%s"', data.get('name',' + @@ -157,12 +158,12 @@ - - Employees - ir.ui.menu - - - + + Employees + ir.ui.menu + + +