Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
1180 Представления

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?

Аватар
Отменить
Автор Лучший ответ

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

Аватар
Отменить
Лучший ответ

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.


Аватар
Отменить
Лучший ответ

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
авг. 25
3389
1
июл. 25
1558
1
авг. 25
1152
0
мая 25
1885
2
апр. 25
4165