~credativ/openobject-server/trunk-csv-import-domain

« back to all changes in this revision

Viewing changes to openerp/addons/base/ir/ir_ui_view.py

  • Committer: Christophe Simonis
  • Date: 2014-04-22 14:46:51 UTC
  • mfrom: (5189.1.7 saas-4)
  • Revision ID: chs@openerp.com-20140422144651-840zze7p5549k88s
[MERGE] forward port of branch saas-4 up to revid 5196 chs@openerp.com-20140422123533-b6lcm76ydf8vpw9u

Show diffs side-by-side

added added

removed removed

Lines of Context:
965
965
        ids = map(itemgetter(0), cr.fetchall())
966
966
        return self._check_xml(cr, uid, ids)
967
967
 
 
968
    def _validate_module_views(self, cr, uid, module):
 
969
        """Validate architecture of all the views of a given module"""
 
970
        assert not self.pool._init or module in self.pool._init_modules
 
971
        cr.execute("""SELECT max(v.id)
 
972
                        FROM ir_ui_view v
 
973
                   LEFT JOIN ir_model_data md ON (md.model = 'ir.ui.view' AND md.res_id = v.id)
 
974
                       WHERE md.module = %s
 
975
                    GROUP BY coalesce(v.inherit_id, v.id)
 
976
                   """, (module,))
 
977
 
 
978
        for vid, in cr.fetchall():
 
979
            if not self._check_xml(cr, uid, [vid]):
 
980
                self.raise_view_error(cr, uid, "Can't validate view", vid)
 
981
 
968
982
# vim:et: