Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
1186 Vues

I created group for user :

<?xml version="1.0" encoding="utf-8" ?>

<odoo>
    <data>
        <!-- *** the new user group -->
        <record id="group_hr_leave_approver" model="res.groups">
            <field name="name">** Leave Approver</field>
            <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
        </record>
    </data>
</odoo>

Created with WordToHTML.net" rel="ugc">https://wordtohtml.net/">WordToHTML.net trial.



i need to make only users who have this group to approve time off . how can i do that?

Avatar
Ignorer
Auteur Meilleure réponse

I need to replace this field with user group where users who have the group can approve the time off

Avatar
Ignorer
Meilleure réponse

Hello Asmaa,

Usually and good practice when creating user group is to first create group record for example:

<record id="time_off_approver_group" model="res.groups">

    <field name="name">Time Off Approvers</field>

    <!-- Add other fields as needed -->

</record>



then associate with base groups for that action to prevent any other operations or base access group to malfunction. for example:

 

" rel="ugc">hr.holidays.status"> Time Off Approval

<record id="time_off_approval_workflow" model="hr.holidays.status">
/>    <field name="name">Time Off Approval</field>
    <!-- Other fields -->

    <field name="group_id" ref="module_name.time_off_approver_group"/>
</record>

" rel="ugc">hr.holidays.status"> Time Off Approval


Hope this help.


Avatar
Ignorer
Meilleure réponse

Hi,

You can xpath the action_approve button in the XML form with inherit_id as hr_holidays.hr_leave_view_form  To add you custom group like this,

<xpath expr="//button[@name='action_approve']" position="attributes">

          <attribute name="groups">module_name.group_hr_leave_approver</attribute> 

</xpath>


Thanks


Avatar
Ignorer
Publications associées Réponses Vues Activité
2
août 25
3390
1
juil. 25
1559
1
août 25
1152
0
mai 25
1887
2
avr. 25
4168