跳至內容
選單
此問題已被標幟
3 回覆
1178 瀏覽次數

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


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
8月 25
3389
1
7月 25
1558
1
8月 25
1152
0
5月 25
1885
2
4月 25
4165