Skip to content

FIX = operator AS $eq #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2021
Merged

FIX = operator AS $eq #31

merged 1 commit into from
Mar 23, 2021

Conversation

tinogis
Copy link
Member

@tinogis tinogis commented Mar 23, 2021

Changes equal operator (=) translation to the $eq operator. It allows mix equal and other operator in the same search:

This fails without this change

model_obj.search(cursor, uid, [('a','=',3),('a','in', [3,4,5])]) 
Fault: <Fault 'int' object has no attribute 'update': 'Traceback (most recent call last):\n  File "/home/erp/src/erp/server/bin/netsvc.py", line 361, in dispatch\n    result = LocalService(service_name)(method, *params)\n  File "/home/erp/src/erp/server/bin/netsvc.py", line 100, in __call__\n    res = getattr(self, method)(*params)\n  File "/home/erp/src/erp/server/bin/service/web_services.py", line 584, in execute\n    res = service.execute(db, uid, object, method, *args)\n  File "/home/erp/src/erp/server/bin/osv/osv.py", line 61, in wrapper\n    return f(self, dbname, *args, **kwargs)\n  File "/home/erp/src/erp/server/bin/osv/osv.py", line 132, in execute\n    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)\n  File "/home/erp/src/erp/server/bin/osv/osv.py", line 123, in execute_cr\n    return getattr(object, method)(cr, uid, *args, **kw)\n  File "/home/erp/src/erp/server/bin/addons/mongodb_backend/orm_mongodb.py", line 462, in search\n    new_args = mdbpool.translate_domain(tmp_args)\n  File "/home/erp/src/erp/server/bin/addons/mongodb_backend/mongodb2.py", line 106, in translate_domain\n    new_domain[field].update(clause[field])\nAttributeError: \'int\' object has no attribute \'update\'\n'>

@tinogis tinogis added the bug label Mar 23, 2021
@tinogis tinogis requested a review from ecarreras March 23, 2021 15:24
@tinogis tinogis self-assigned this Mar 23, 2021
@ecarreras ecarreras merged commit 766d9a0 into gisce Mar 23, 2021
@ecarreras ecarreras deleted the FIX_=_as_eq branch March 23, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants