changeset 19961004f56e in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset;node=19961004f56e
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
(grafted from eb4883a7e477a9b1403f6294cb3b241b13224ad1)
diffstat:
src/view/form.js | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diffs (25 lines):
diff -r 8853b60b31ed -r 19961004f56e src/view/form.js
--- a/src/view/form.js Thu May 02 12:58:12 2019 +0200
+++ b/src/view/form.js Sun May 05 19:33:48 2019 +0200
@@ -315,15 +315,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]) {