← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 813974] [NEW] Could we deprecate passing a single id to ORM methods

 

Public bug reported:

Most ORM methods accept an "ids" argument which can be either an integer or a list of integers.
This is supported and well documented, and fixes have been accepted to support single integers (Bug #740202, Bug #812723 and probably others).

Unfortunately this is very badly known even among the core developers.
This regularly leads people to talk at cross purposes (as in Bug #740202) and it's also a bit controversial (as in https://lists.launchpad.net/openerp-expert-framework/msg00397.html).

As a consequence it may break in some new standard feature, and has never worked in numerous third-party modules.
Almost all the code in OpenERP passes "ids" as lists, even for only one element.
So, this feature is confusing and of little use.

Could it just be deprecated in the next version ?
A warning would be issued when an ORM method is called with a single int.
The documentation would be updated to indicate that "ids" should be a list, and a footnote would be added to explain that single integers are deprecated.

Then we could drop the feature completely in some later version.

Lionel Sausin.

** Affects: openobject-server
     Importance: Undecided
         Status: New

** Project changed: openobject-addons => openobject-server

-- 
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/813974

Title:
  Could we deprecate passing a single id to ORM methods

Status in OpenERP Server:
  New

Bug description:
  Most ORM methods accept an "ids" argument which can be either an integer or a list of integers.
  This is supported and well documented, and fixes have been accepted to support single integers (Bug #740202, Bug #812723 and probably others).

  Unfortunately this is very badly known even among the core developers.
  This regularly leads people to talk at cross purposes (as in Bug #740202) and it's also a bit controversial (as in https://lists.launchpad.net/openerp-expert-framework/msg00397.html).

  As a consequence it may break in some new standard feature, and has never worked in numerous third-party modules.
  Almost all the code in OpenERP passes "ids" as lists, even for only one element.
  So, this feature is confusing and of little use.

  Could it just be deprecated in the next version ?
  A warning would be issued when an ORM method is called with a single int.
  The documentation would be updated to indicate that "ids" should be a list, and a footnote would be added to explain that single integers are deprecated.

  Then we could drop the feature completely in some later version.

  Lionel Sausin.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/813974/+subscriptions


Follow ups

References