openerp - Getting the Employee id of the Log User in Odoo - 8 -


good day have problem in filtering of odoo 8 field want select employee id of log user add in xml

<field name="employee_id" style = "width:500px" domain = "[('id', '=', user.id.employee_id.id)]" options="{'no_create': true}"/> 

but have error says

uncaught error: nameerror: name 'user' not defined.

is there right way employee id of log user here in odoo 8 ?

to obtain employee of logged user way:

resource = self.env['resource.resource'].search([('user_id','=',self.env.user.id)]) employee = self.env['hr.employee'].search([('resource_id','=',resource.id)]) 

of course not easy put inside domain, maybe can use stored computed field save user_id of employee inside table, can write domain way:

[('user_id', '=', uid)] 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -