← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 821041] Re: domain restriction in osv_memory models

 

Hello,

The osv_memory  will soon be disappearing from the server, it will be
replaced by osv with just some boolean information to know that it
should be cleaned from the db from time to time so these will work as
normal osv but with short life span.

Thanks

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/821041

Title:
  domain restriction in osv_memory models

Status in OpenERP Server:
  New

Bug description:
  Hi

  I have a return statement of the form:

      return {
              'name':_("Products to Process"),
              'view_mode': 'tree',
              'view_id': False,
              'view_type': 'tree',
              'res_model': 'mrp.component',
              'res_ids': new_ids,
              'type': 'ir.actions.act_window',
              'nodestroy': True,
              'target': 'new',
              'domain': '[]',
              'context': context
          }

  where mrp.component is an osv_memory object
  changing the domain restriction to something meaningful (e.g. [("parent_id", "=", None)] gives an error as it uses the search method of the orm class instead of orm_memory
  (of course, I've overwritten the orm_memory::search method as it would always return all the keys)

  [2011-08-04 19:33:28,665][helti_test] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/akasha/.virtualenvs/openerp6/lib/python2.6/site-packages/openerp-server/addons/mrp_components/mrp_components.py", line 31, in search
      return super(mrp_component, self).search(cr, uid, args, offset, limit, order, context, count)
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/osv/orm.py", line 1745, in search
      return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/osv/orm.py", line 2073, in _search
      val = eval('data[arg[0]]'+'==' +' arg[2]', locals())
    File "/home/akasha/versioning/bzr/openerp-6/server/bin/tools/safe_eval.py", line 284, in safe_eval
      return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
    File "", line 1, in <module>
  KeyError: 'parent_id'

  I'm using the 6.0 branch of openobject-server

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


References