← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 683558] [NEW] XML-RPC search doesn't work for functional fields

 

On Wednesday 01 December 2010, you wrote:
> Public bug reported:
> 
> I would expect an XML-RPC call an a functional field would work exactly
> as on a non-functional field. However, it appears that it is simply
> ignored in a search, not restricting things at all. I appreciate that
> this is tricky to do on a code level, but it would make the XML-RPC
> interface more usable and consistent.
> 
> To clarify, I'd like the following XML-RPC call to restrict the ids
> returned to only those which have qty_available > 0:
> 

This is not an XML-RPC bug, it is the way ORM works.

Indeed, if you just define a function field, you will not be able to search it 
by default. 

But, if you read the documentation:
http://doc.openerp.com/developer/2_5_Objects_Fields_Methods/field_type.html#fnct-
search-parameter

.. it explains about this behavior and that you *need* to define a search 
function.
You see, the conversion from the record data to the "output" of the field is a 
one-way function. Eg. qty_available = some_sum(...) , which the ORM cannot 
inverse itself.

-- 
XML-RPC search doesn't work for functional fields
https://bugs.launchpad.net/bugs/683558
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: New

Bug description:
I would expect an XML-RPC call an a functional field would work exactly as on a non-functional field. However, it appears that it is simply ignored in a search, not restricting things at all. I appreciate that this is tricky to do on a code level, but it would make the XML-RPC interface more usable and consistent.

To clarify, I'd like the following XML-RPC call to restrict the ids returned to only those which have qty_available > 0:

sock.execute(db, uid, passwd, 'product.product', 'search', [('qty_available','>',0.0)])

Whereas at present it appears to simply return all ids regardless of their computed qty_available value.

This is with the latest bzr checkout (2156) of http://bazaar.launchpad.net/~openerp/openobject-server/5.0/





References