Clear view caches when dashboard fields of user are modified
Closes #13662
This commit is contained in:
1 parent
beddddb6d8
commit
56afef04ec
1 file changed
+13
-2
@@ -1,7 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.model import ModelView, fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
|
||||
class User(metaclass=PoolMeta):
|
||||
@@ -27,3 +27,14 @@ class User(metaclass=PoolMeta):
|
||||
@staticmethod
|
||||
def default_dashboard_layout():
|
||||
return 'square'
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
pool = Pool()
|
||||
View = pool.get('ir.ui.view')
|
||||
super().write(*args)
|
||||
for values in args[1:None:2]:
|
||||
if values.keys() & {'dashboard_layout', 'dashboard_actions'}:
|
||||
View._view_get_cache.clear()
|
||||
ModelView._fields_view_get_cache.clear()
|
||||
break
|
||||
Reference in new issue
Block a user