mirror of
https://github.com/NaN-tic/tryton-gtk2.git
synced 2023-12-14 03:12:58 +01:00
Be more tolerant to xml view errors
This commit is contained in:
parent
11af36613e
commit
74b7407022
2 changed files with 11 additions and 8 deletions
|
@ -65,6 +65,8 @@ class ParserTree(ParserInterface):
|
|||
if boolean_fields in node_attrs:
|
||||
node_attrs[boolean_fields] = \
|
||||
bool(int(node_attrs[boolean_fields]))
|
||||
if fname not in fields:
|
||||
continue
|
||||
fields[fname].update(node_attrs)
|
||||
node_attrs.update(fields[fname])
|
||||
cell = CELLTYPES.get(fields[fname]['type'])(fname, treeview,
|
||||
|
|
|
@ -90,14 +90,15 @@ class Parse(object):
|
|||
if name in ('form','tree'):
|
||||
self.title = attrs.get('string', self.title)
|
||||
self.container.new(self.col)
|
||||
elif name=='field':
|
||||
val = attrs.get('select', False) \
|
||||
or self.fields[str(attrs['name'])].get('select', False)
|
||||
if val:
|
||||
if int(val) <= 1:
|
||||
self.add_widget(attrs, val)
|
||||
else:
|
||||
self.add_widget_end.append((attrs, val))
|
||||
elif name == 'field':
|
||||
if attrs['name'] in self.fields:
|
||||
val = attrs.get('select', False) \
|
||||
or self.fields[attrs['name']].get('select', False)
|
||||
if val:
|
||||
if int(val) <= 1:
|
||||
self.add_widget(attrs, val)
|
||||
else:
|
||||
self.add_widget_end.append((attrs, val))
|
||||
|
||||
def add_widget(self, attrs, val):
|
||||
ftype = attrs.get('widget', self.fields[str(attrs['name'])]['type'])
|
||||
|
|
Loading…
Reference in a new issue