Skip to content
Snippets Groups Projects
Commit be658bb8 authored by Sébastien Theys's avatar Sébastien Theys
Browse files

[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#37363

Pr: #37363
Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
parent 83f9a3e2
No related branches found
No related tags found
No related merge requests found
......@@ -259,6 +259,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):
......@@ -298,6 +299,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)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment