[FIX] base: correctly define arch as depending on context

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) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2019-10-11 17:42:04 +00:00
committed by fw-bot
parent f294ccdb03
commit 5f082f87c5
+2
View File
@@ -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)):