From eda802ca9435be10bbeae8684e10e8abb18adfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 11 Feb 2018 14:34:46 +0100 Subject: [PATCH] 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 --- company.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/company.py b/company.py index aa302ed08a..5165c36816 100644 --- a/company.py +++ b/company.py @@ -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()