Hi,
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 :)..
thanks!
best, mark
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
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 :)..
thanks!
best, mark
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)