I have created a record rule using xml as follows:
<record id="filter_user_hotel" model="ir.rule">
<field name="name">Filter Hotel Allowed</field>
<field name="model_id" search="[('model','=','hotel.reservation')]" model="ir.model"/>
<field name="groups" eval="[(4, ref('hotel.group_hotel_user'))]"/>
<field name="domain_force">[('warehouse_id.id','=',user.warehouse_id_hotel.id)]</field>
</record>
I created a new field in res.users "warehouse_id_hotel" so each user could see the records related to his warehouse only.
whenever I change the warehouse of the user changes don't take effect until I restart the server ,so what is causing this behavior ?
You save my life too)))
Thanks, it works at odoo 15.