Hi,
in the Odoo docs it says:
Workflow transitions can be restricted to a specific group. Users outside the group can not trigger the transition.
How can I achieve this in the xml definition of the transition?
This is my transition definition:
<record model="workflow.transition" id="paper_reviewed_to_accepted">
<field name="act_from" ref="paper_reviewed"/>
<field name="act_to" ref="paper_accepted"/>
<field name="signal">accepted</field>
</record>
SOLUTION:
make the transition only available to a group:
<record model="workflow.transition" id="paper_reviewed_to_accepted">
<field name="act_from" ref="paper_reviewed"/>
<field name="act_to" ref="paper_accepted"/>
<field name="group_id" ref="module.xml_id_of_the_group"/>
<field name="signal">accepted</field>
</record>
If you have a button to trigger the transition it is still visible to everybody. To only make it visible to the group, for which the transition is available, do:
<button name="in_review" type="workflow" string="Set to In Review"
states="submitted" class="oe_highlight"
groups="module.xml_id_of_the_group"/>