Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tryton/tryton/gui/window/view_form/model/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def _set_value(
if (f not in group.fields and '.' not in f
and not f.startswith('_'))}
attr_fields = functools.reduce(
operator.or_,
lambda a, b: a.update(b) or a,
(v['fields'] for v in self.attrs.get('views', {}).values()),
{})
fields = {n: attr_fields[n]
Expand All @@ -762,8 +762,8 @@ def _set_value(
to_fetch = field_names - attr_fields.keys()
if to_fetch:
try:
fields |= RPCExecute('model', self.attrs['relation'],
'fields_get', list(to_fetch), context=context)
fields.update(RPCExecute('model', self.attrs['relation'],
'fields_get', list(to_fetch), context=context))
except RPCException:
return

Expand Down
3 changes: 1 addition & 2 deletions tryton/tryton/gui/window/view_form/model/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# this repository contains the full copyright notices and license terms.
import functools
import logging
import operator

import tryton.common as common
from tryton.common import RPCException, RPCExecute
Expand All @@ -17,7 +16,7 @@
def get_x2m_sub_fields(f_attrs, prefix):
if f_attrs['loading'] == 'eager' and f_attrs.get('views'):
sub_fields = functools.reduce(
operator.or_,
lambda a, b: a.update(b) or a,
(v.get('fields', {}) for v in f_attrs['views'].values()),
{})
x2m_sub_fields = []
Expand Down