Reputation: 85
I want to make this field clickable only when user_id matches current user, tried it with readonly, attrs, options, nothing worked
<field name="stage_id" widget="statusbar" attrs="{'clickable':[('user_id','=','user.id')]}"/>
Upvotes: 0
Views: 3116
Reputation: 1080
This is for odoo 8, but it probably works for odoo 10.
You don't need to use quotes on user.id
. Domains are evaluated with safe_eval()
, which includes some variables such as context
(current context dict), user
(current user record), time
(python's time
module) and so on.
So you should try :
<field name="stage_id" widget="statusbar" attrs="{'clickable':[('user_id','=', user.id)]}"/>
If this still doesn't work, try to make the field readonly.
Upvotes: 2
Reputation:
Try out:
<field name="stage_id" widget="statusbar" attrs="{'clickable':[('user_id','=','uid')]}"/>
Upvotes: 0