Skip to content

Commit d4a608c

Browse files
[FIX] attr_domains2expr: missing parameter and tracestack if view
doesn't have inherit_id -This commit add missing 'cr' parameter to util.ref method and fix when getting combined arch for inherit view it might get stace track if that view doesn't have inherit_id, check at https://github.com/odoo/odoo/blob/86fb725c03171b84287812d0a9d1e00c86044acd/odoo/addons/base/models/ir_ui_view.py#L628 closes #83 Signed-off-by: Alvaro Fuentes Suarez (afu) <[email protected]>
1 parent 25d4583 commit d4a608c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/base/17.0.1.3/attr_domains2expr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ def adapt_view(cr, view_xmlid):
5858
IrUiView = util.env(cr)["ir.ui.view"].with_context(lang=lang)
5959
```
6060
"""
61-
vid = util.ref(view_xmlid)
61+
vid = util.ref(cr, view_xmlid)
6262
IrUiView = util.env(cr)["ir.ui.view"]
6363
view = IrUiView.browse(vid)
6464

6565
# disable view to avoid it being applied to the parent arch
6666
view.active = False
6767
# get combined arch of the parent view
68-
comb_arch = view.inherit_id._get_combined_arch()
68+
comb_arch = view.inherit_id._get_combined_arch() if view.inherit_id else None
6969

7070
# update current view arch
7171
new_arch = etree.fromstring(view.arch_db)

0 commit comments

Comments
 (0)