fields.function does not work in multi mode for different types

Bug #781247 reported by Olivier Dony (Odoo)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP's Framework R&D

Bug Description

When implementing a fields.function with multi='foo', there are many cases that will fail, mostly when several fields.function using the same 'multi' value have different types.

The root of the problem lies in osv/fields.py, because function.get() does some post-processing of the returned values, but it does not properly handle the 'multi' case, where the returned values are dicts, and contain a mapping of field names to values.

The function.get() method should be rewritten to verify if it is a 'multi' function being called, and perform the post-processing of all individual values returned according to the _type of the corresponding column (in an efficient manner). This will also take care of the cases where 'multi' results would not work at all (like currently for binary function fields, apparently).

If any doubt, do not hesitate to ask me.

Related branches

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Note: to ease up validation of the patch and regression testing, we should use the test_orm module provided by Panos here: https://code.launchpad.net/~xrg/openobject-addons/extra-trunk-xrg.

Changed in openobject-server:
status: Confirmed → In Progress
Revision history for this message
Yogesh (SerpentCS) (yogesh-serpentcs) wrote :

Hello,

It has been fixed in lp:~openerp-dev/openobject-server/trunk-bug-781247-ysa
Revision no :- 3421
Revision ID: <email address hidden> and It will be merged soon
to the trunk server.

Thanks,

Changed in openobject-server:
status: In Progress → Fix Committed
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

The fix has been applied on trunk server @3462 <email address hidden>

Thanks,

Changed in openobject-server:
status: Fix Committed → 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.