diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2020-06-26 07:33:02 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2020-06-26 09:15:44 +0000 |
| commit | 03a0b2d22c6676a1ad77e3fd9272e3c6bcff62c9 (patch) | |
| tree | 7530dff8847ce384787fc37a14056064a1541851 /addons/web/models | |
| parent | 257371bab52b009c027ead19857fbd865f2bc5b4 (diff) | |
[FIX] web: company report style on change layout
When company layout is changed, we do not update the company styles for
report: thus we still have the old style for other layout that will not
change anything (besides font).
opw-2269849
closes #53706
closes odoo/odoo#53720
X-original-commit: 8897701b1754b40d8a83c5681907c38fb205657f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web/models')
| -rw-r--r-- | addons/web/models/models.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/web/models/models.py b/addons/web/models/models.py index f4bcdb9be06..d7840f1da95 100644 --- a/addons/web/models/models.py +++ b/addons/web/models/models.py @@ -754,13 +754,15 @@ class ResCompany(models.Model): @api.model def create(self, values): res = super().create(values) - if 'primary_color' in values or 'secondary_color' in values or 'font' in values: + style_fields = {'external_report_layout_id', 'font', 'primary_color', 'secondary_color'} + if not style_fields.isdisjoint(values): self._update_asset_style() return res def write(self, values): res = super().write(values) - if 'primary_color' in values or 'secondary_color' in values or 'font' in values: + style_fields = {'external_report_layout_id', 'font', 'primary_color', 'secondary_color'} + if not style_fields.isdisjoint(values): self._update_asset_style() return res |
