diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-08-10 17:24:43 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-08-11 10:28:12 +0200 |
| commit | 3b7fb9934d795ff6971727089e6bbe0a77c06476 (patch) | |
| tree | 856f713a684eee79aa3fbe8eab5303fd30923597 /addons/web/static/src/js/widgets/data_export.js | |
| parent | a7985a5abb49326991a97c707611bb3670dbfdd3 (diff) | |
[FIX] web: BasicModel: keep onchanges on unknown fields
Let's assume the following situation: we have a one2many field
displayed as a list in a form view. The list isn't editable, so
when a subrecord is clicked, it is opened in a form view in a
dialog. In this form view, there is a relational field X that is
not in the list. In the main form view, there is a field with an
onchange. When its value changes, the onchange returns a new
value for the one2many: a command 5 (delete all), and a command 0
(create) with a dict of values containing a value for X. However,
as X is unknown as long as no subrecord has been open in the dialog,
the value for X can't be processed (we don't know the type of X,
so we don't know how to process the value).
Before this rev., when this happened, we discarded the value of X.
This caused an issue for example in the Quotation form view (with
website_quote installed):
- create a new Quotation
- set PartnerShip Contract as quotation template -> the onchange
returns two 'create' commands for the order_line one2many
- click on one of the two subrecords in the one2many -> error.
This rev. ensures to keep changes on unknown fields. We keep them
unprocessed, and once the form view is opened, we process and
apply them.
Diffstat (limited to 'addons/web/static/src/js/widgets/data_export.js')
0 files changed, 0 insertions, 0 deletions
