How to reset odoo cache by python

Viewed 3148

I have a problem doing write () in odoo, update by db but in odoo view no, it still shows the previous value, I was checking the documentation and it may be the cache. There is an invalidate_cache () method, which is for this according to the documentation but I don't know how to execute it, I've tried several ahem:

self.env.invalidate_cache (), self.env.cr.invalidate_cache ()
self.env ['go.rule']. invalidate_cache (),
self.env ['go.rule']. clear_cache (),
self.env ['product.template']. clear_caches (), self.env.invalidate_all (),
self.env ['ir.module.module']. update_list (),
self.env ['product.template']. cr.invalidate_cache (),

but I think that there is no way, when I restart the module that I create to perform the write () by a planned action, the real value is recently displayed. The question would be if someone knows how to reset the cache by python code

0 Answers
Related