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

I have an requirement that when i install a module the groups which i have created should be equal to True how can i achieve this?

อวตาร
ละทิ้ง

@yoromang not work for me?!

คำตอบที่ดีที่สุด

Make it part of a group which is installed by default might be a handy solution.

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

Check below example here group Edit Product Sale Price is true for all base users 

<record id="group_edit_product_sale_price" model="res.groups">
    <field name="name">Edit Product Sale Price</field>
    <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('base.group_user')),(4,ref('your_module.your_group'))]"/>

</record>
อวตาร
ละทิ้ง

You might have to re-install your module for the changes to take effect

@syrine it should work, try to re-install if possible
You can also do it manually. set the group on the default user ( settings -> users & companies -> users (filter: inactive users) .

each new user copies its default values from the (default user template)

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 24
2114
1
เม.ย. 23
14572
how to assign menu to groups แก้ไขแล้ว
9
ธ.ค. 23
23861
1
พ.ค. 20
6322
1
พ.ค. 19
2819