Skip to Content
Menu
This question has been flagged
3499 Views

hi

I add a field in "users" form to set each users department. I add this field in this way :

1. from this path :

------------> addons/hr/hr_department.py

add this class:

class res_users(osv.osv):
    _name = 'res.users'    _inherit = 'res.users'
    _columns = {        'context_department_id': fields.many2one('hr.department', 'Departments'),    }

----------------------------------------

2. then after restart server, this field added in DB in "res_users" table.

3. then from UI from developer mode, in users form , "manage view", I added "context_department_id" to form.

----------------------------------------

Now the problem is that when I add other fields to other module, for example in analytic module, when I want "upgrade" module, I have this error:

----------------------------------

raise ValidationError('\n'.join(errors))ParseError: "Invalid view definition
Error details:
Field `context_department_id` does not exist
Error context:
View `res.users.groups`[view_id: 153, xml_id: base.user_groups_view, model: res.users, parent_id: 150]None" while parsing /odoo/odoo-server/addons/analytic/security/analytic_security.xml:21, near<record id="group_analytic_accounting" model="res.groups">        <field name="name">Analytic Accounting</field>        <field name="category_id" ref="base.module_category_hidden"/>    </record>

------------------------------------------------

but I don't know what is problem?


Thanks

Avatar
Discard