summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-05-04 10:35:55 +0200
committerAaron Bohy <aab@odoo.com>2017-05-04 12:39:07 +0200
commit7d26d244a438a71d633922e043b18e488dbe269b (patch)
tree6fe18cecb03fb2ff7f4239e3dcb813f8de82b8e3 /addons/web/static/src/js/views/basic/basic_renderer.js
parent250e716c3a12e88acb4a199b427dc47d4ec55d5d (diff)
[FIX] web: BasicModel: trigger onchange when x2m is valid
When a record is added in an x2many field with an onchange, the onchange is only triggered once the new record is valid (i.e. when all its required fields have a correct value). However, there was an issue in the code checking the validity of a record, as it checked, for each required field, that its value wasn't falsy (!value). This is incorrect for several type of fields: - numerical: a value of 0 is correct - boolean: should be always considered as correct - x2m: their value is a dataPoint, so it is never falsy, what should be check is the number of records inside the dataPoint. This was an issue for example in the sale.order form view, as the onchange wasn't triggered when an order line was added (with a set product), so the total amount wasn't updated correctly.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
0 files changed, 0 insertions, 0 deletions