On the website, I want to show users sales orders and products.
The problem I encountered is that Odoo does not want to display both (sales orders and products).
Therefore, I added recording rules and access rights for sale.order, product.tamplate, and product.product.
This works for sales orders; orders are displayed on the website, but not for products.
Sale order rule
<record id="rule_portal_sale_order_final_recipient" model="ir.rule">
<field name="name">Portal: Sale Orders by Final Recipient</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
<field name="domain_force">[('final_recipient_id', '=', user.partner_id.id)]</field>
</record>
Products rules
<record id="rule_portal_product_template_final_recipient" model="ir.rule">
<field name="name">Portal: Product template</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="global" eval="False"/>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
<field name="domain_force">[]</field>
</record>
<record id="rule_portal_product_product_final_recipient" model="ir.rule">
<field name="name">Portal: Product product</field>
<field name="model_id" ref="product.model_product_product"/>
<field name="global" eval="False"/>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
<field name="domain_force">[]</field>
</record>
I also tried adding (1 , “=”, 1) to the domain, but that doesn't work either. I can find my entry rules in the portal settings, and there are only my own rules there, which means that there are no rules that can be over than my rules.
Access rights
access__product_product__group_user,access__product_product__group_user,product.model_product_product,base.group_user,1,1,1,1
access__product_product__group_portal,access__product_product__group_portal,product.model_product_product,base.group_portal,1,0,0,0
access__product_template__group_user,access__product_template__group_user,model_product_template,base.group_user,1,1,1,1
access__product_template__group_portal,access__product_template__group_portal,model_product_template,base.group_portal,1,0,0,0
access__sale_order__group_portal,access__sale_order__group_portal,model_sale_order,base.group_user,1,1,1,1
access__sale_order__group_user,access__sale_order__group_user,model_sale_order,base.group_portal,1,0,0,0
UPDATE:
I fortgot to add that i have multicompany. And just now i changed company_id in users settings, and sale_orders with products works fine. All products have field company_id = False.
That is for one company all works, for another not. Its very strange