0

I would like the button (draft) to be visible just by a simple user group and not by the group manager. but since the manager is first a simple user before being a manager, how to do it?

Here's the button

<button name="button_draft" string="Draft" states="refuse,approve" type="object"/>

Thank you for your help

1 Answers1

0

Geraldine M

I prefer to create a group and add your users to it and then you can assign the group to your button in two ways:

Using Odoo GUI:

Edit the view and then add groups attribute to your button as below:

<button name="button_draft" string="Draft" states="refuse,approve" type="object" groups="YOUR GROUP"/>

Thanks

Dipen Shah
  • 2,396
  • 2
  • 9
  • 21
  • I'm in an activity validation mechanism. the employee when he submits his activity (can put it back in draft) which will be validated by the manager but however, the manager is also an employee like the others before being a manager. so I would rather have the draft button only displayed on the activities so the user is employed. j'ai pensé à utiliser un domain comme ceci mais aucun resultat `````` – Geraldine M Apr 15 '20 at 12:11
  • @GeraldineM In that case, you can use the same specific condition based on the button instead of the group. like the manager have some boolean so on the button use with attrs and check that boolean is true than visible. – Dipen Shah Apr 15 '20 at 12:19
  • i don't understand well. can you take an example please – Geraldine M Apr 15 '20 at 12:33
  • @GeraldineM how do you identify that this is only employee and this is manager rights employee? – Dipen Shah Apr 15 '20 at 12:40
  • I've created groups that they've associated with – Geraldine M Apr 15 '20 at 12:54
  • @GeraldineM Okay so on user-level you enable the group for the manager only ? and another user will be employee. – Dipen Shah Apr 15 '20 at 12:59
  • I have a user group and the other manager (herite of user) so I attribute each group to the users concerned. – Geraldine M Apr 15 '20 at 13:11