fields.function does not work in multi mode for different types
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
- Olivier Dony (Odoo): Approve
- Yogesh (SerpentCS) (community): Needs Resubmitting
- Naresh(OpenERP): Pending requested
-
Diff: 124 lines (+43/-46)1 file modifiedopenerp/osv/fields.py (+43/-46)
Changed in openobject-server: | |
status: | Confirmed → In Progress |
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.