← Back to team overview

openerp-india team mailing list archive

[Bug 927817] Re: _is_osv_memory (6.1 Trunk)

 

** Project changed: openobject-addons => openobject-server

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/927817

Title:
  _is_osv_memory (6.1 Trunk)

Status in OpenERP Server:
  New

Bug description:
  In ir_model.py
  classe ir_model

      def _is_osv_memory(self, cr, uid, ids, field_name, arg, context=None):
          models = self.browse(cr, uid, ids, context=context)
          res = dict.fromkeys(ids)
          for model in models:
              res[model.id] = self.pool.get(model.model).is_transient()
          return res

  If you create a new model, test it, and finaly you remove it, model
  now removed from ir_model table, so when we try to configure group
  this function is called and browse all id result of this error :
  AttributeError: 'NoneType' object has no attribute 'is_transient'

  Because the model in ir_model table NOT IN self.pool because we remove
  it from code, and not remove from database.

  maybe add something like that to validate

  for model in models:
      res[model.id] = self.pool.get(model.model) and self.pool.get(model.model).is_transient() or False

  or
  for model in models:
      obj =  self.pool.get(model.model)
      res[model.id] = obj and obj.is_transient() or False

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/927817/+subscriptions


References