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

Only allow some products to be selected in a new quotation. This would be dependent on the user logged in.

Some users will see more products. Other users will see less products.

This will be in effect for new quotations only.

For previously created quotations by higher users, the product restriction will not be in effect even if the lower user logs in.

The restriction will be only for new quotations by lower user, who should only be able to see some products.

The higher user can see all products. Once the higher user does the quotation. The lower user will process the quotation to sales order and finally to invoice.

Is there a module that can restrict the display of products depending on the user login?

อวตาร
ละทิ้ง

Hi,


Have you found any solution?


Regards,

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

Hello,

With record rules, I would define a "read access" rule for the lower user group that only allows them to see a certain category of product.

Hope it helps,


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

Hi, 

Try adding a many2many field in res.users like below,

allowed_product_ids = fields.Many2many("product.template", string="Allowed Products")

Then add this below record rule to product.template model,

<odoo>


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


        <field name="name">Allowed Products</field>


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


        <field name="domain_force">[('id', 'in', user.allowed_product_ids)]</field>


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


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


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


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


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


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


    </record>


</odoo>


Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 15
3516
0
ต.ค. 20
4475
1
มี.ค. 15
5216
How to create a read only user / group แก้ไขแล้ว
3
มี.ค. 22
17442
2
มี.ค. 15
11492