changeset eb4883a7e477 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=eb4883a7e477
description:
Do not rely on field views to load form fields
If the views attribute of the field is wrong or empty, the record will
not
load the value for this field. The views attribute can be empty if it
was
created by copying the field from its parent.
So it is safer to not rely on this attribute which is there only for
optimization and instead always use all the fields defined on the view.
issue8289
review263471002
diffstat:
src/view/form.js | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diffs (25 lines):
diff -r 1aac8f912ee7 -r eb4883a7e477 src/view/form.js
--- a/src/view/form.js Fri May 03 18:17:04 2019 +0200
+++ b/src/view/form.js Sun May 05 19:33:48 2019 +0200
@@ -248,15 +248,13 @@
// Force to set fields in record
// Get first the lazy one from the view to reduce number of
requests
var fields = [];
- for (name in record.model.fields) {
+ for (name in this.widgets) {
field = record.model.fields[name];
- if (field.views.has(this.view_id)) {
- fields.push([
- name,
- field.description.loading || 'eager' == 'eager',
- field.views.size,
- ]);
- }
+ fields.push([
+ name,
+ field.description.loading || 'eager' == 'eager',
+ field.views.size,
+ ]);
}
fields.sort(function(a, b) {
if (!a[1] && b[1]) {