openerp-expert-framework team mailing list archive
-
openerp-expert-framework team
-
Mailing list archive
-
Message #00401
Re: Accepting (int, long) apart from list
On Monday 09 August 2010, you wrote:
> I like being able to use a single id as a parameter for
> write/read/browse..., it is more user (console) friendly, specially with
> the browse.
>
> But it is true that it may cause mistakes, for example I have seen some
> modules expecting the return for this methods to be a single element
> (like the analytic account bug of two months ago, where only the first
> account move to be confirmed got its analytic entries created).
That one is a different problem!
Currently, in the framework, it is only orm.read() that will return a different
type of result if you call it with int(id) or list(ids) ..
And browse(), of course, but that had been *designed* to work that way from
the very start.
If you are talking about other, custom methods, that is a responsibility of
those who define them. If you need an analytic.calc_something(cr, uid, id|ids,
..), you should clearly define if you prefer an integer or a list there. And,
please, have the same type of result.
Follow ups