Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
861 มุมมอง

Hi,


I want to avoid that some users could create new taks in odoo, so I'm creating a module where trying to hide the new button to a specific group but it doesn't found with xpath. Do you know how is called "new" button in Odoo? New, Create? That is my code:


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

<odoo>

        <record id="project_task_hide_task" model="ir.ui.view">

            <field name="model">project.task</field>

            <field name="inherit_id" ref="project.view_task_tree2"/>

            <field name="arch" type="xml">

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

                    <attribute name="groups">Administrator</attribute>

                </xpath>

            </field>

        </record>       

</odoo>


Thank you


Regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just remove the CREATE permission for that Group:

See https://www.odoo.com/documentation/18.0/applications/general/users/access_rights.html

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
506
2
มิ.ย. 25
2408
1
มิ.ย. 25
874
3
พ.ค. 25
2401
Install your own modules in Odoo แก้ไขแล้ว
2
ก.ค. 25
1399