Odoo Help


HRM: autocreate user account

test user
on 8/13/14, 4:29 AM 670 views


On OpenERP 7.0 (local install) I would like to:

- In the HRM module
- When creating an employee
- automatically create a related user for portal login

I'm sure it is possible but am looking for ideas on how :)..



best, mark


Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 8/13/14, 5:29 AM

Override the "create" function on the hr.employee model in your own module. Then, create a portal user in the overwritten method, putting it in the values for your create method.

Something like:

class new_hr(osv.osv):

    _name = 'hr.employee'

    _inherit = 'hr.employee'

    def create(self, cr, uid, vals, context)

        my_variables = {<<list of name, groups, etc.>>}

        user_id = self.pool.get('res.users').create(cr, uid, my_variables)

        vals.update({'user_id': user_id})

        return super(new_hr, self).create(cr, uid, vals, context)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/13/14, 4:29 AM
Seen: 670 times
Last updated: 3/16/15, 8:10 AM