Hello,
I am trying to make appear a smart button when a user of the "leader group" is looking the view. I write this function:
<button name="button_leader_approved"
Hello,
I am trying to make appear a smart button when a user of the "leader group" is looking the view. I write this function:
Probably your problem is related to multi recordset, try this:
@api.depends('state')
def _compute_can_leader_approved(self):
user = self.env.user
for rec in self:
if (rec.state == 'to_approve' and user.has_group('sprogroup_purchase_request.group_sprogroup_purchase_request_leader')):
rec.can_leader_approved = True
else:
rec.can_leader_approved = False
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscrever-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
4
mai. 24
|
16219 | |||
|
1
abr. 24
|
5827 | |||
|
0
nov. 23
|
4502 | |||
|
Blank White Page After log in to Odoo13
Resolvido
|
1
set. 23
|
4500 | ||
|
2
ago. 23
|
7315 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
To customize modules, just go through these tips: https://github.com/sehrishnaz/learnopenerp/wiki