← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

** Changed in: openobject-server/5.0
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/366089

Title:
  Read function inconsistent between orm and orm_memory

Status in OpenObject Server:
  Fix Released
Status in OpenObject Server 5.0 series:
  Confirmed
Status in OpenObject Server trunk series:
  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).