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

In v16, when trying to add groups to access rights for an inherited view, I get the following error:

"Inherited view cannot have 'Groups' define on the record. Use 'groups' attributes inside the view definition"

This was how I did things previously in v13, etc.

Now when I try to use groups as an attribute like this:




to prevent users in the group stock.group_stock_manager from being able to create, edit, or delete products, it doesn't work.  When I do the above, it turns editing off for everyone, regardless of the groups attribute.

How can I turn off create/edit/delete for specified groups only in v16?

Edit: I uploaded a photo of the code because the forum stripped out all of the XML tags.

อวตาร
ละทิ้ง

try to use group Directly in attribute like this(remove code after position from xpath line
<attribute name="groups">stock.group_stock manager</attribute>
(rest of the attribute same)

Thanks

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

Hi,

If you are trying to add the groups in your inherited view you need to add it by using the attribute. You cant give the groups directly in the XPath tag

example:

<attribute name="group">stock.group_stock_manager</attribute>


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

But this simply adds a group attribute to the form. I want to make it so I can add new attributes to the form only for certain groups.

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

Changed in v16 for inherited views, set groups on the field. So make two of the same field, one for each group or two different views/actions/menus for each group with the different fields distinguished per view. Or if you can make it a base view.


https://github.com/odoo/odoo/blob/217b494c2573dc0a0b879d67403c80bc02d7e1f6/odoo/addons/base/models/ir_ui_view.py#L484



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

Hello Russ,

Same Question:

Ref . https://www.odoo.com/forum/help-1/what-do-i-have-to-do-to-prevent-a-group-from-being-able-to-create-edit-delete-products-247444

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 23
3804
3
พ.ย. 24
4313
2
ก.ค. 23
3682
0
มิ.ย. 23
2470
Group access permissings wrong แก้ไขแล้ว
1
ก.พ. 23
2356