I want to make button/field visible to only those user who is in the approved_user_id field.
This code is in my .py file
@api.depends()
def _get_current_user(self):
self.update({'current_user' : self.env.user.id})
This is code of my .xml file
<field name="current_user" invisible="1"/>
<button name="action_sendForApprove" type="object" string="Request To Approve" class="oe_highlight" attrs="{'invisible': ['|',('state','=','draft'),('approved_by_id','!=','current_user')]}"/>
But this is not working for me. can any plz help me regarding it.
Any help will be thank full.