_static_search() got an unexpected keyword argument 'context'

Bug #562199 reported by Carlos Liebana
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Agile Methodology
Fix Released
Medium
Joël Grand-Guillaume @ camptocamp

Bug Description

Testing the module, I get the following error:

Environment Information :
System : Windows-32bit-SP2
OS Name : nt
Operating System Release :
Operating System Version : 32bit
Operating System Architecture : 32bit
Operating System Locale : es_ES.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.9
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 576, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 58, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2203, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2333, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/agile-openerp-support/modec_methodo.py", line 79, in get
    ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids),('static_task','=',True)], limit=self._limit, context=context)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2994, in search
    (qu1, qu2, tables) = self._where_calc(cr, user, args, context=context)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2975, in _where_calc
    e.parse(cr, user, self, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/expression.py", line 160, in parse
    subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/fields.py", line 641, in search
    return self._fnct_search(obj, cr, uid, obj, name, args, context=context)
TypeError: _static_search() got an unexpected keyword argument 'context'

Details:

New Draft MODEC Project, in Project Type, new:
Name: Server Installation
Steps, new:
Name: Initial Configuration
Project type: Server Installation (isn't this redundant?)
New task:
Functional block, new:
Name: Server
Version: 5.0.9
Task, new task:
When I focus on Step, i get the error.

No information pre-loaded in a new 5.0.7 database.

Revision history for this message
Hugo Santos (Factorlibre) (hugosantosred) wrote :

I think this bug is because in the declaration of _static_search function isn't defined the context variable.

This can be solved by adding the context variable to the function definition in project.py file of the addon.

def _static_search(self, cursor, user, obj, name, args, context = {})

Revision history for this message
Carlos Ch. (solracch) wrote :

Hi,

I did what Hugo Santos commented in #1
and some other errors appeared...
I modified a couple of things in the _static_search function
here's the patch

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

Thanks for the patch :) !

Regards,

Changed in agile-openerp-support:
importance: Undecided → Medium
assignee: nobody → Joël Grand-Guillaume @ CampToCamp (jgrandguillaume-c2c)
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.