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:
|
if boolean_fields in node_attrs:
|
||||||
node_attrs[boolean_fields] = \
|
node_attrs[boolean_fields] = \
|
||||||
bool(int(node_attrs[boolean_fields]))
|
bool(int(node_attrs[boolean_fields]))
|
||||||
|
if fname not in fields:
|
||||||
|
continue
|
||||||
fields[fname].update(node_attrs)
|
fields[fname].update(node_attrs)
|
||||||
node_attrs.update(fields[fname])
|
node_attrs.update(fields[fname])
|
||||||
cell = CELLTYPES.get(fields[fname]['type'])(fname, treeview,
|
cell = CELLTYPES.get(fields[fname]['type'])(fname, treeview,
|
||||||
|
|
|
@ -90,14 +90,15 @@ class Parse(object):
|
||||||
if name in ('form','tree'):
|
if name in ('form','tree'):
|
||||||
self.title = attrs.get('string', self.title)
|
self.title = attrs.get('string', self.title)
|
||||||
self.container.new(self.col)
|
self.container.new(self.col)
|
||||||
elif name=='field':
|
elif name == 'field':
|
||||||
val = attrs.get('select', False) \
|
if attrs['name'] in self.fields:
|
||||||
or self.fields[str(attrs['name'])].get('select', False)
|
val = attrs.get('select', False) \
|
||||||
if val:
|
or self.fields[attrs['name']].get('select', False)
|
||||||
if int(val) <= 1:
|
if val:
|
||||||
self.add_widget(attrs, val)
|
if int(val) <= 1:
|
||||||
else:
|
self.add_widget(attrs, val)
|
||||||
self.add_widget_end.append((attrs, val))
|
else:
|
||||||
|
self.add_widget_end.append((attrs, val))
|
||||||
|
|
||||||
def add_widget(self, attrs, val):
|
def add_widget(self, attrs, val):
|
||||||
ftype = attrs.get('widget', self.fields[str(attrs['name'])]['type'])
|
ftype = attrs.get('widget', self.fields[str(attrs['name'])]['type'])
|
||||||
|
|
Loading…
Reference in a new issue