← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 788789] Re: [6.0.x][purchase] action_picking_create: broken extensibility

 

Hello Amit,

You are right, in the sale module too action_ship_create create shippings
and doesn't properly returns the ids of what it created as one would expect
from a method creating database records for proper extensibility. You can
still find out those ids bit hitting the database again in your overrider
but that's certainly not a clean and efficient solution.

Now, in purchase it's worth because you return some arbitrary id: the last
one, this is confusing and useless cause it will never be robust.
So I would even prefer you return True/False instead.
but ideally methods that create database records return the ids of what they
created. End even more ideally you even get a chance to get the
values/objects that will be created/written in the database BEFORE writing
them to the database, so you can minimize database accesses accross
overriders and change objects before they are persisted instead of having to
persist and them hit the the database again to read them also may be change
them.

Any chance we improve here on the main methods such as
purchase#action_ship_create for 6.1 or will that be postponed with all the
friction that will imply when the user base will be larger?


On Tue, Jun 7, 2011 at 8:38 AM, Amit Parik (OpenERP) <amp@xxxxxxxxxxx>wrote:

> Hello Raphael Valyi,
>
> I have checked your issue with latest trunk and stable both.
>
> But I have seen that in sale module "action_ship_create" return a "True"
> not dictionary of all the generated pickings.
>
> So would you please elaborate with more information on this and tell
> where you faced the problem if  purchase#action_picking_create method
> returns a only the id of the last picking.
>
> Thanks.
>
> ** Changed in: openobject-addons
>       Status: New => Incomplete
>
> --
> You received this bug notification because you are a member of OpenERP
> Drivers, which is subscribed to OpenERP Addons.
> https://bugs.launchpad.net/bugs/788789
>
> Title:
>  [6.0.x][purchase] action_picking_create: broken extensibility
>
> Status in OpenERP Modules (addons):
>   Incomplete
>
> Bug description:
>  Hello,
>
>  there is a design issue in purchase#action_picking_create
>  the method actually applies to a collection of purchase orders but
> actually returns only the id of the last picking that is generated.
>  To play nice efficiently with overriders, you need to change that and
> return a dictionary of all the generated pickings, just as you do in
> sale#action_ship_create
>

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

Title:
  [6.0.x][purchase] action_picking_create: broken extensibility

Status in OpenERP Modules (addons):
  Incomplete

Bug description:
  Hello,

  there is a design issue in purchase#action_picking_create
  the method actually applies to a collection of purchase orders but actually returns only the id of the last picking that is generated.
  To play nice efficiently with overriders, you need to change that and return a dictionary of all the generated pickings, just as you do in sale#action_ship_create


References