[IMP] hr: show the employees from the category
authorStephane Wirtel <stw@openerp.com>
Wed, 26 Oct 2011 15:03:24 +0000 (17:03 +0200)
committerStephane Wirtel <stw@openerp.com>
Wed, 26 Oct 2011 15:03:24 +0000 (17:03 +0200)
bzr revid: stw@openerp.com-20111026150324-1c5k1lsq2yvqhfq9

addons/hr/hr.py
addons/hr/hr_view.xml

index 7a704de..f641a42 100644 (file)
@@ -47,7 +47,8 @@ class hr_employee_category(osv.osv):
         'name': fields.char("Category", size=64, required=True),
         'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
         'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True),
-        'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories')
+        'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories'),
+        'employee_ids': fields.many2many('hr.employee', 'employee_category_rel', 'category_id', 'emp_id', 'Employees'),
     }
 
     def _check_recursion(self, cr, uid, ids, context=None):
index a59269b..bc68736 100644 (file)
                 <form string="Employee Category">
                     <field name="name" />
                     <field name="parent_id" />
+                    <separator string="Employees" colspan="4" />
+                    <field name="employee_ids" colspan="4" nolabel="1" />
                 </form>
             </field>
         </record>