Skip to content

Commit 067ebbb

Browse files
committed
[FIX] fields: keep values for some selections
In change_field_selection_values when the mapping arg contains keys that are also present in values, we do not want to remove the values that are still valid closes #157 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 5deee62 commit 067ebbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@ def change_field_selection_values(cr, model, field, mapping, skip_inherit=()):
964964
WHERE f.id = s.field_id
965965
AND f.model = %s
966966
AND f.name = %s
967-
AND s.value IN %s
967+
AND s.value = ANY(%s)
968968
""",
969-
[model, field, tuple(mapping)],
969+
[model, field, [k for k in mapping if k not in mapping.values()]],
970970
)
971971

972972
def adapter(leaf, _or, _neg):

0 commit comments

Comments
 (0)