From aa7131eaae7659fcc62182257ef7e0ea533aacf9 Mon Sep 17 00:00:00 2001 From: Nishit Thakkar Date: Tue, 13 Feb 2024 05:27:40 +0000 Subject: [PATCH] [FIX] util/fields : add force_adapt in adapt_depends Adding `force_adapt` to consider whole path instead of just the leaf part closes odoo/upgrade-util#43 Signed-off-by: Christophe Simonis (chs) --- src/util/fields.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/fields.py b/src/util/fields.py index 633d8480..539dd05d 100644 --- a/src/util/fields.py +++ b/src/util/fields.py @@ -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)