Sunday 8 December 2019

V13 : Record Rule Domain Changes not applied


Sometimes the record rule not working correctly even we wrote correct the record rule. There are many reason but one of the reason is records saved in cache.

In this cases you have to clear the cache.

Problem :
Let's take one example suppose on user I have field product category and I want to show these product categories Manufacturing order to user.



Record Rule:

[('product_id.categ_id','in',[g.id for g in user.x_studio_product_category])]



Solution:
----------

in mrp.production ass search_read method and clear the cache

    @api.model
    def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None):
        self.clear_caches()
        res = super(MrpProduction, self).search_read(domain, fields, offset, limit, order)
        return res

Video:



Contact for any Odoo Services

..Enjoy..

1 comment:

  1. Is your business looking for efficient, accurate bookkeeping services? Our proven approach and world-class service will meet all of your needs. Our main goal is to take the pressure off by providing a reliable and quick tax filing service.

    ReplyDelete