In my custom module I use stock picking type to see the warehouse operations of the user.
class ResUsers(models.Model):
_inherit = 'res.users'
default_picking_type_ids = fields.Many2many(
'stock.picking.type', 'stock_picking_type_users_rel',
'user_id', 'picking_type_id', string='Warehouse Operations')
I added this in user form.
In my sexurity.xml file add
<record id="filter_user_stock_picking_type" model="ir.rule">
<field name="name">Filter Stock Picking Type</field>
<field name="model_id" search="[('model','=','stock.picking.type')]" model="ir.model"/>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="domain_force">[('id','in', [ s.id for s in user.default_picking_type_ids ])]</field>
</record>
so it is worked in when a user is created and assigns stock operation.
But when changed the stock operation to particular user, it will not affect.
How to resolve this issue??
I think, the problem is the
Odoo Cache
. The old values are stored in the Cache for a long time and your change will not take any effect.You can try it to clear the cache. It helped me to solve the similar problem.