Skip to content

Commit

Permalink
[FIX] m2o_to_x2m: fix dup key insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Sep 1, 2024
1 parent a133cda commit 2398d2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,11 @@ def m2o_to_x2m(cr, model, table, field, source_field):
SELECT id, %s
FROM %s
WHERE %s is not null
EXCEPT
SELECT %s, %s
FROM %s
"""
% (rel, id1, id2, source_field, table, source_field),
% (rel, id1, id2, source_field, table, source_field, id1, id2, rel),
)
elif isinstance(columns[field], tuple(o2m_types)):
if isinstance(columns[field], One2many): # >= 8.0
Expand Down

0 comments on commit 2398d2f

Please sign in to comment.