← Back to team overview

openerp-expert-framework team mailing list archive

Re: OpenERP should unify osv function signature

 

Funny, today, a few hours ago, while writing the classical:
        if isinstance(ids, (int, long)):
            ids = [ids]
once again, I was telling myself this could make a nice little decorator.

Just to add two other cts, some osv function redefined in (main) addons do
not accept both list and integer which is quite frustrating, just to name a
few:
res.lang write
account.move.line write
account.account write
project.work write
(I've just checked quickly for 'def write' in 6.0 addons, there are
certainly lots of other)

Regards,
Xavier

On Fri, Nov 25, 2011 at 5:54 AM, Nicolas Bessi <nicolas.bessi@xxxxxxxxxxxxxx
> wrote:

> Hello,
>
> OpenERP should unify osv function signature, if function is public ids
> should be array else function must be private. A decorator at ORM level
> should do the work and transform id into array of ids.
>
> My two ct.
>
> Nicolas
>
>
> --------------------------------------------------------------------
> *Nicolas Bessi *
> Senior ERP consultant
> Business Solution technical manager
>
> Camptocamp SA
>  PSE A
> CH-1015 Lausanne
> http://www.openerp.camptocamp.com
>
> Phone: +41 21 619 10 26
> Office: +41 21 619 10 10
> Fax : +41 21 619 10 00
> --------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References