'Validate architecture of custom views (= without xml id) for a given model.
This method is called at the end of registry update.'

@api.model
def _validate_custom_views(self, model):

    query = "SELECT    max(v.id)\n                                                                                    FROM    ir_ui_view    v\n                                                                LEFT    JOIN    ir_model_data    md    ON    (md.model    =    'ir.ui.view'    AND    md.res_id    =    v.id)\n                                                                                WHERE    md.module    NOT    IN    (SELECT    name    FROM    ir_module_module)\n                                                                                        AND    v.model    =    %s\n                                                                                        AND    v.active    =    true\n                                                                    GROUP    BY    coalesce(v.inherit_id,    v.id)"
    self._cr.execute(query, [model])
    rec = self.browse(map(itemgetter(0), self._cr.fetchall()))
    return rec.with_context({'load_all_views': True})._check_xml()
