Skip to content

Commit 15cb73a

Browse files
committed
[FIX] util/records: ensure matching for False/0 values
Before this patch the matching for `False` (bool) or `0` (int/float) would be incorrect as it will assume NULL. Part-of: odoo/upgrade#5132
1 parent 53b42ea commit 15cb73a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def ensure_xmlid_match_record(cr, xmlid, model, values):
662662
where = []
663663
data = ()
664664
for k, v in values.items():
665-
if v:
665+
if v is not None:
666666
where += ["%s = %%s" % (get_value_or_en_translation(cr, table, k),)]
667667
data += (v,)
668668
else:

0 commit comments

Comments
 (0)