← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 366089] Re: Read function inconsistent between orm and orm_memory

 

This issue also affect 5.0, the patch must be back-ported to get a
consistent API.

-- 
Read function inconsistent between orm and orm_memory
https://bugs.launchpad.net/bugs/366089
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: Fix Released

Bug description:
In orm.py:

The function read in orm object is designed to return a single dictionnary if the argument 'ids' is a single id and a list of dictionnary if 'ids' is itself a list.

The function read in orm_memory seems to have been designed to do the same but currently it can only return a list:

'ids' is tested at the beginning but is also modified:
            if isinstance(ids, (int, long)):
                ids = [ids]
making the last check located a few lines later totally useless:
            if isinstance(ids, (int, long)):
                return result[0]

An easy patch is attached (I tested it quickly).