2 答案
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
Hi,
Have you found any solution?
Regards,