Skip to content

Commit

Permalink
[FIX] util/fields : add force_adapt in adapt_depends
Browse files Browse the repository at this point in the history
Adding `force_adapt` to consider whole path instead of just the leaf part

closes #43

Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
  • Loading branch information
thni-odoo committed Feb 14, 2024
1 parent c852d63 commit aa7131e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ def adapt_depends(cr, model, old, new, skip_inherit=()):
for id_, model, depends in cr.fetchall():
temp_depends = depends.split(",")
for i in range(len(temp_depends)):
domain = _adapt_one_domain(cr, target_model, old, new, model, [(temp_depends[i], "=", "depends")])
domain = _adapt_one_domain(
cr, target_model, old, new, model, [(temp_depends[i], "=", "depends")], force_adapt=True
)
if domain:
temp_depends[i] = domain[0][0]
new_depends = ",".join(temp_depends)
Expand Down

0 comments on commit aa7131e

Please sign in to comment.