Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
1182 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
3389
1
thg 7 25
1558
1
thg 8 25
1152
0
thg 5 25
1885
2
thg 4 25
4165