[IMP] HR: put department_id in user prefernces
authorHarry (Open ERP) <hmo@tinyerp.com>
Fri, 19 Feb 2010 11:19:13 +0000 (16:49 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Fri, 19 Feb 2010 11:19:13 +0000 (16:49 +0530)
bzr revid: hmo@tinyerp.com-20100219111913-mo0hexc03ugo4btp

addons/hr/hr_department.py
addons/hr/hr_department_view.xml

index fd3146b..72bd9fd 100644 (file)
@@ -163,14 +163,7 @@ class res_users(osv.osv):
     _columns = {
         'parent_id': fields.function(_parent_compute, relation='res.users',fnct_search=_parent_search, method=True, string="Managers", type='many2many'),
         'child_ids': fields.function(_child_compute, relation='res.users', fnct_search=_child_search,method=True, string="Subordinates", type='many2many'),
+        'context_department_id': fields.many2one('hr.department', 'Departments'),
     }
 res_users()
-
-#class users(osv.osv):
-#    _inherit = 'res.users'
-#    _description = "Users"
-#    _columns = {
-#        'context_department_id': fields.many2one('hr.department', 'Departments'),
-#    }
-#users()
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index e34c96e..1ae7295 100644 (file)
@@ -83,6 +83,7 @@
             <field name="arch" type="xml">
                 <notebook position="inside">
                     <page string="Departements Informations">
+                        <field name="context_department_id" completion="1" widget="selection" string="Department"/>
                         <separator string="Managers" colspan="4"/>
                         <field name="parent_id" nolabel="1" colspan="4"/>
                         <separator string="Subordinates" colspan="4"/>
@@ -91,7 +92,7 @@
                 </notebook>
             </field>
         </record>
-               <!--<record model="ir.ui.view" id="view_department_form_simple_modif_inherited1">
+               <record model="ir.ui.view" id="view_department_form_simple_modif_inherited1">
             <field name="name">view.department.form.hr.inherited1</field>
             <field name="model">res.users</field>
             <field name="inherit_id" ref="base.view_users_form_simple_modif" />
                 </page>
             </field>
         </record>
-
-        <record id="view_department_form_simple_modif_inherited2" model="ir.ui.view">
-                <field name="name">view.department.form.hr.inherited2</field>
-                <field name="model">res.users</field>
-                <field name="type">form</field>
-                <field name="inherit_id" ref="base.view_users_form"/>
-                <field eval="18" name="priority"/>
-                <field name="arch" type="xml">
-                    <field name="password" position="after">
-                    <field name="context_department_id" completion="1" widget="selection"/>
-                    </field>
-                </field>
-        </record>
-    --></data>
+        </data>
 </openerp>