node.tag = 'data'
node.attrib.pop('id', None)
return etree.tostring(node)
- raise ValueError("Could not find view arch definition in file '%s' for xmlid '%s'" % (filename, xmlid))
+ _logger.warning("Could not find view arch definition in file '%s' for xmlid '%s'" % (filename, xmlid))
+ return None
xpath_utils = etree.FunctionNamespace(None)
xpath_utils['hasclass'] = _hasclass
('tree','Tree'),
('form','Form'),
('graph', 'Graph'),
+ ('pivot', 'Pivot'),
('calendar', 'Calendar'),
('diagram','Diagram'),
('gantt', 'Gantt'),
'arch': fields.function(_arch_get, fnct_inv=_arch_set, string='View Architecture', type="text", nodrop=True),
'arch_db': fields.text('Arch Blob'),
'arch_fs': fields.char('Arch Filename'),
- 'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='cascade', select=True),
+ 'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='restrict', select=True),
'inherit_children_ids': fields.one2many('ir.ui.view','inherit_id', 'Inherit Views'),
'field_parent': fields.char('Child Field'),
'model_data_id': fields.function(_get_model_data, type='many2one', relation='ir.model.data', string="Model Data",
return values
def create(self, cr, uid, values, context=None):
- if 'type' not in values:
+ if not values.get('type'):
if values.get('inherit_id'):
values['type'] = self.browse(cr, uid, values['inherit_id'], context).type
else:
if not node.get(action) and not Model.check_access_rights(cr, user, operation, raise_exception=False):
node.set(action, 'false')
if node.tag in ('kanban'):
- group_by_field = node.get('default_group_by')
- if group_by_field and Model._all_columns.get(group_by_field):
- group_by_column = Model._all_columns[group_by_field].column
- if group_by_column._type == 'many2one':
- group_by_model = Model.pool.get(group_by_column._obj)
+ group_by_name = node.get('default_group_by')
+ if group_by_name in Model._fields:
+ group_by_field = Model._fields[group_by_name]
+ if group_by_field.type == 'many2one':
+ group_by_model = Model.pool[group_by_field.comodel_name]
for action, operation in (('group_create', 'create'), ('group_delete', 'unlink'), ('group_edit', 'write')):
if not node.get(action) and not group_by_model.check_access_rights(cr, user, operation, raise_exception=False):
node.set(action, 'false')
e.set('data-oe-xpath', node_path)
if not e.get('data-oe-model'): return
- if set(('t-esc', 't-escf', 't-raw', 't-rawf')).intersection(e.attrib):
+ if {'t-esc', 't-raw'}.intersection(e.attrib):
# nodes which fully generate their content and have no reason to
# be branded because they can not sensibly be edited
self._pop_view_branding(e)