From 5f082f87c5edd4bce335a444a8f417d0e7edb3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 8 Oct 2019 10:44:30 +0000 Subject: [PATCH] [FIX] base: correctly define `arch` as depending on context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Computed fields that depend on the context now have to be declared as such. To reproduce the issue: - go on the form view of any view - update the arch of the view - save - click on action "reset view architecture" - select hard reset - no diff is shown Expected: a diff should be shown `arch_base` depends on `arch`, so even though no current flow actually uses it when the context is changed, update its `depends_context` as well to be safe. closes odoo/odoo#38536 Pr: #37363 X-original-commit: be658bb87a9e9dd84909e6e6d2cb9107b87a0d52 Signed-off-by: Sébastien Theys (seb) --- odoo/addons/base/models/ir_ui_view.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/addons/base/models/ir_ui_view.py b/odoo/addons/base/models/ir_ui_view.py index 2856313132b..2eabcdc69ec 100644 --- a/odoo/addons/base/models/ir_ui_view.py +++ b/odoo/addons/base/models/ir_ui_view.py @@ -258,6 +258,7 @@ actual arch. """) @api.depends('arch_db', 'arch_fs', 'arch_updated') + @api.depends_context('read_arch_from_file') def _compute_arch(self): def resolve_external_ids(arch_fs, view_xml_id): def replacer(m): @@ -297,6 +298,7 @@ actual arch. view.write(data) @api.depends('arch') + @api.depends_context('read_arch_from_file') def _compute_arch_base(self): # 'arch_base' is the same as 'arch' without translation for view, view_wo_lang in zip(self, self.with_context(lang=None)):