Commit aad0d58
[FIX] util/records: ensure no duplicates for m2m when replacing refs
There are two ways an update of references could fail in an m2m table.
If there is a record already in the table matching the currently updated
row. Example:
```
mapping old new
1 3
2 3
Fails for:
m2m fk col2
1 x -updated-> 3 x !error
3 x
```
Or, if we have multiple ids mapped to the same new one. Example:
```
mapping old new
1 3
2 3
Fails for:
m2m fk col2
1 x -updated-> 3 x
2 x -updated-> 3 x !error
```
Part-of: #33
Co-authored-by: "Christophe Simonis" <chs@odoo.com>1 parent 2bd20f0 commit aad0d58
2 files changed
+54
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
1024 | 1025 | | |
1025 | 1026 | | |
1026 | 1027 | | |
1027 | | - | |
| 1028 | + | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
| |||
1036 | 1037 | | |
1037 | 1038 | | |
1038 | 1039 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1042 | 1067 | | |
1043 | 1068 | | |
1044 | 1069 | | |
| |||
1062 | 1087 | | |
1063 | 1088 | | |
1064 | 1089 | | |
1065 | | - | |
| 1090 | + | |
1066 | 1091 | | |
1067 | 1092 | | |
1068 | | - | |
| 1093 | + | |
1069 | 1094 | | |
1070 | 1095 | | |
1071 | 1096 | | |
| |||
0 commit comments