'Complete the setup of models.
This must be called after loading modules and before using the ORM.
:param partial: ``True`` if all models have not been loaded yet.'

def setup_models(self, cr, partial=False):

    lazy_property.reset_all(self)
    env = odoo.api.Environment(cr, SUPERUSER_ID, {})
    ir_model = env['ir.model']
    cr.execute('SELECT    *    FROM    ir_model    WHERE    state=%s', ('manual',))
    for model_data in cr.dictfetchall():
        model_class = ir_model._instanciate(model_data)
        model_class._build_model(self, cr)
    models = env.values()
    for model in models:
        model._prepare_setup()
    self._m2m = {}
    for model in models:
        model._setup_base(partial)
    for model in models:
        model._setup_fields(partial)
    for model in models:
        model._setup_complete()
