Commit bfe8509
committed
[FIX] core: first onchange when adding a line in a one2many field
Consider a form view with a one2many field, which has no form subview.
Also the form view of the comodel (the one2many field's lines) contains
the inverse many2one field of the one2many field. When adding a new
line on some existing record, the form view shows the many2one field as
empty, instead of being the main record.
Explanation: the form view of the line invokes onchange() with the main
record's values (dict) as the value of the many2one field. Inside
onchange(), the field is actually set to a new record corresponding to
the main record. Alas, when that value is sent back to the form, the
new record is serialized as False.
Solution: let onchange() serialize the new record as its origin record
instead.
closes odoo#114641
X-original-commit: d137ea4
Signed-off-by: Raphael Collet <rco@odoo.com>1 parent dbaf8da commit bfe8509
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
538 | 552 | | |
539 | 553 | | |
540 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3021 | 3021 | | |
3022 | 3022 | | |
3023 | 3023 | | |
3024 | | - | |
3025 | | - | |
3026 | | - | |
| 3024 | + | |
| 3025 | + | |
3027 | 3026 | | |
3028 | 3027 | | |
3029 | 3028 | | |
| |||
0 commit comments