Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
1185 Visualizações

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
Cancelar
Autor Melhor resposta

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

Avatar
Cancelar
Melhor resposta

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
ago. 25
3390
1
jul. 25
1559
1
ago. 25
1152
0
mai. 25
1887
2
abr. 25
4168