Clear user preferences cache

The company values are used in the user preferences so its cache should be
cleared when it is modified.

issue7113
review39121002
This commit is contained in:
Cédric Krier
2018-02-11 14:34:46 +01:00
parent 4c0b67990b
commit eda802ca94
+8 -1
View File
@@ -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.pool import PoolMeta, Pool
__all__ = ['Company']
@@ -31,3 +31,10 @@ class Company:
@staticmethod
def default_hours_per_work_year():
return 1920
@classmethod
def write(cls, *args):
pool = Pool()
User = pool.get('res.user')
super(Company, cls).write(*args)
User._get_preferences_cache.clear()