Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Base

Entity: ir.ui.view

Compute Method: _compute_xml_id

Inputs Method Outputs
  • id
xml_ids = collections.defaultdict(list)
domain = [('model', '=', 'ir.ui.view'), ('res_id', 'in', self.ids)]
for data in self.env['ir.model.data'].sudo().search_read(domain, ['module', 'name', 'res_id']):
            xml_ids[data['res_id']].append("%s.%s" % (data['module'], data['name']))
for view in self:
            view.xml_id = xml_ids.get(view.id, [''])[0]

Back to entity