Commit 5c74479
committed
[FIX] partner_supplier_ref_sequence: do not set sequence when copying
The field is_supplier is not copied, therefore any supplier copied should not have, at first, any suppler reference. However the observed behaviour was the opposite, the supplier was being
copied with is_supplier=False and with supplier_ref. The issue is that the is_supplier is not in the vals_to_check when calling _needs_supplier_ref from the copy so the current partner,
the one being copied and self, value was used to see if the sequence was needed. This is an error, we can not use the self value if this value is not the one that is being set on the copied
partner.
To solve this we have first removed the copy inherit, as it is indeed not relevant. The copy will later trigger the create, and in the vals we will have already what we need. Then, in the create
inherit we call _needs_supplier_ref with an empty self, as we don't want to use the values of any possible self already set. That only makes sense on the write.1 parent 3b8396a commit 5c74479
1 file changed
+2
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
| |||
0 commit comments