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

Hello,

I'm working on odoo 10, e-commerce module, product.template.

In that I giving a access to default user group to create a product, so they can only see their own created products not all products, (hidden other users products), 

How can i set access like own documents only to product entity ?

Ảnh đại diện
Huỷ bỏ

In general ... this is a not good idea! Solution @Ibrahim, bellow is good, but you will have many ... many problems arising from this in other modules.

Câu trả lời hay nhất

this is done by using access rules. ( ir.rule) 

<record id="rule_case_READ" model="ir.rule">

        <field name="name">READ product template</field>

        <field name="model_id" ref="model_product_template"/>

        <field name="global" eval="False"/>

        <field name="groups" eval="[(4, ref('Module.YOUR_Group_HERE'))]"/>

        <field name="perm_read" eval="True"/>

        <field name="perm_write" eval="False"/>

        <field name="perm_create" eval="False"/>

        <field name="perm_unlink" eval="False"/>

        <field name="domain_force">

            [('create_uid', '=', uid)]

        </field>

    </record>


Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 17
3308
1
thg 7 16
7886
3
thg 12 23
21786
1
thg 11 24
1149
1
thg 4 23
3445