I am using odoo 10 enterpeise . I want to show buttons to specific users not to groups because there would be many users in a group and i want to only show below button who have
One of the thing i know to use a field in attrs the field must be Mentionsed in the form.
i don't know how to get the value of the user id in the form. but if there is not a short
way like uid
or user
you can work arround this, just create a m2o field to res.users
make this field compute field with store = False.
# by default store = False this means the value of this field
# is always computed.
current_user = fields.Many2one('res.users', compute='_get_current_user')
@api.depends()
def _get_current_user(self):
for rec in self:
rec.current_user = self.env.user
and you can use this field in your form.
sorry for my english.