From 514dfa074820b78cdb76fb6f57159de21719cff1 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 14 Sep 2011 10:53:11 +0200 Subject: [PATCH] [IMP] hr_payroll: added tree view on payroll structures and rule categories. + few renaming of stupid copied/pasted xml_id meaningless bzr revid: qdp-launchpad@openerp.com-20110914085311-nfg3sg0cdi5jv9y6 --- addons/hr_payroll/hr_payroll.py | 2 + addons/hr_payroll/hr_payroll_view.xml | 63 ++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index cdf6549fedd..9578f322217 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -50,6 +50,7 @@ class hr_payroll_structure(osv.osv): 'company_id':fields.many2one('res.company', 'Company', required=True), 'note': fields.text('Description'), 'parent_id':fields.many2one('hr.payroll.structure', 'Parent'), + 'children_ids':fields.one2many('hr.payroll.structure', 'parent_id', 'Children'), } def _get_parent(self, cr, uid, context=None): @@ -175,6 +176,7 @@ class hr_salary_rule_category(osv.osv): '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.rule.category', 'Parent', help="Linking a salary category to its parent is used only for the reporting purpose."), + 'children_ids': fields.one2many('hr.salary.rule.category', 'parent_id', 'Children'), 'note': fields.text('Description'), 'company_id':fields.many2one('res.company', 'Company', required=False), } diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 8bb56bb1200..dd750e57282 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -58,7 +58,7 @@ - + hr.payroll.structure.tree hr.payroll.structure tree @@ -71,6 +71,19 @@ + + hr.payroll.structure.tree + hr.payroll.structure + tree + children_ids + + + + + + + + hr.payroll.structure.select @@ -116,18 +129,32 @@ - + Salary Structures hr.payroll.structure form - + + + Salary Structures + hr.payroll.structure + tree + [('parent_id','=',False)] + + + @@ -415,6 +442,19 @@ + + hr.salary.rule.category.tree.view + hr.salary.rule.category + tree + children_ids + + + + + + + + hr.salary.rule.category.select @@ -441,6 +481,19 @@ parent="payroll_configure" sequence="11" /> + + Salary Rule Categories + hr.salary.rule.category + tree + + +