[sale] Pickings get duplicated with order_policy == 'prepaid' (5.0)

Bug #494352 reported by Dukai Gábor
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
High
Unassigned

Bug Description

Hi!
5.0 latest bzr.
A prepaid type of sale.order is confirmed and the draft invoice is created. The draft invoice is validated and the payment wizard is used to add a full payment. After that the workflow creates the picking for the order. The problem is here. The workflow calls sale.order.action_ship_create() and the last line of action_ship_create() is a self.write() that triggers the workflow to call action_ship_create() once more. This results in duplicate stock.pickings created.

Related branches

Changed in openobject-addons:
importance: Undecided → High
importance: High → Undecided
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Dukai, this sounds frightening at first sight. However, I just tested with addons rev #2475 and can't reproduce it: only one picking is generated, order status and picked/paid check-boxes are properly set.

So can you check again with the very last revisions? Can you please do a "bzr diff" in addons to make sure you have no custom patch?

Thank you very much

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Dukai,

I followed the same steps but could not reproduce the error.

I went to outgoing products: picking from internal location to output.
I went to delivery orders: picking from output to customers.

Else than this, no duplicate picking is created.

I would like to request you to check again with fresh code.

Thank you.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Jay and Dukai,

This is still unclear to me how exactly it happens. But on at least two different installs, I could now reproduce that bug!
However, when I tried before and also now on a different PC, we were not able to reproduce it. So I can confirm the bug occur, but we still don't know what are the exact conditions to reproduce it. We will try to find it out, sorry for not having spotted that sooner.

Changed in openobject-addons:
status: Invalid → Confirmed
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello, tried again on a new fresh mrp_profile + demo database with addons rev #2518 and could reproduce it at first try, doing exactly what Dukai described: as soon as you pay the "payment before delivery" invoice two picking instead of one are generated.

So I'm flagging as important and for 5.0.7 if that can still be fixed (I didn't assigned it before to 5.0.7 because Tiny was already 3 weeks late on the 5.0.7 schedule they gave to partners, while there were confirmed regressions to fix meanwhile that were arguably more important than this suspected bug and nobody else confirmed it meanwhile).

Changed in openobject-addons:
importance: Undecided → High
milestone: none → 5.0.7
Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

WOW,

What a research Raphael, this bug will burn the hair of openerp noses:).

its really critical.

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Guys,

I would like to ask you to check with this patch.

Thank you for your patience and comments.

Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

Hey, you know what!
I take my comments back! its promising change, working seemingly normal.

i say,it ws generated due to the change for invoice_except issue.

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

hello Jay,

I confirm your patch works for me and I prefer that kind of new code, especially when it replaces such spaghetti code.
Now I tested only simples flows, please double test on complex flows to make sure this doesn't cause regressions elsewhere.
But I repeat, at least it fixes the bug and the resulting code doesn't look ugly anymore.

Thank you very much

Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

Hi:

Testing on last downloaded bazaar version, I could not reproduce error before applying patch, so I would like to know the exact steps you follow on to obtain it.

After that, I tested after applying the patch and I never obtain duplicated pickings so if it is working for you, it must be right.

But I say again I could not reproduce error before applying the patch, so I'm not sure I'm testing the right test case. We are using continuously prepaid on ecommerce shops and even in that case it was working properly for us, so I'm really interested knowing exactly what conditions or cases were causing this error.

Thank you very much.

Ana

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 494352] Re: [sale] Pickings get duplicated with order_policy == 'prepaid' (5.0)

Guys, just one precision: I had no trouble reproducing the error before
applying the patch, so for us it really did the job.

Raphaël Valyi
http://www.akretion.com

On Fri, Feb 26, 2010 at 8:05 PM, Ana Juaristi Olalde
<email address hidden>wrote:

> Hi:
>
> Testing on last downloaded bazaar version, I could not reproduce error
> before applying patch, so I would like to know the exact steps you
> follow on to obtain it.
>
> After that, I tested after applying the patch and I never obtain
> duplicated pickings so if it is working for you, it must be right.
>
> But I say again I could not reproduce error before applying the patch,
> so I'm not sure I'm testing the right test case. We are using
> continuously prepaid on ecommerce shops and even in that case it was
> working properly for us, so I'm really interested knowing exactly what
> conditions or cases were causing this error.
>
> Thank you very much.
>
> Ana
>
> --
> [sale] Pickings get duplicated with order_policy == 'prepaid' (5.0)
> https://bugs.launchpad.net/bugs/494352
> You received this bug notification because you are subscribed to
> OpenObject Addons.
>
> Status in OpenObject Addons Modules: In Progress
>
> Bug description:
> Hi!
> 5.0 latest bzr.
> A prepaid type of sale.order is confirmed and the draft invoice is created.
> The draft invoice is validated and the payment wizard is used to add a full
> payment. After that the workflow creates the picking for the order. The
> problem is here. The workflow calls sale.order.action_ship_create() and the
> last line of action_ship_create() is a self.write() that triggers the
> workflow to call action_ship_create() once more. This results in duplicate
> stock.pickings created.
>
>
>

Changed in openobject-addons:
milestone: 5.0.7 → 5.0.8
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Ana,

You may follow these steps:
1. Install Manufacturing profile with demo data.
2. Create a sale order with policy 'payment before delivery', confirm the SO.
3. Look at the invoice it has created, Validate it and Pay.
4. Sales order should have created 2 pickings at the same time.

The solution attached by the patch is right.

Let us know asap, so we can commit.

Thanks.

Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

Hi Jay:

I installed minimal profile and then spanish localization modules. We always
do like that on fresh installing. We never use manufacturing or other
profiles.

So, I tested like that
1. Install minimal profile with demo data and spanish localization modules.
2. Create a sale order with policy 'payment before delivery', confirm the
SO.
3. Look at the invoice it has created, Validate it and Pay.

4. Sales order should have created 2 pickings at the same time. --> I could
not reproduce this step. Only one picking was created. I tested without
installing the patch and after installing the patch, so it's working also
for me

Thank you!!!

2010/3/2 Jay (Open ERP) <email address hidden>

> Hello Ana,
>
> You may follow these steps:
> 1. Install Manufacturing profile with demo data.
> 2. Create a sale order with policy 'payment before delivery', confirm the
> SO.
> 3. Look at the invoice it has created, Validate it and Pay.
> 4. Sales order should have created 2 pickings at the same time.
>
> The solution attached by the patch is right.
>
> Let us know asap, so we can commit.
>
> Thanks.
>
> --
> [sale] Pickings get duplicated with order_policy == 'prepaid' (5.0)
> https://bugs.launchpad.net/bugs/494352
> You received this bug notification because you are subscribed to
> OpenObject Addons.
>
> Status in OpenObject Addons Modules: In Progress
>
> Bug description:
> Hi!
> 5.0 latest bzr.
> A prepaid type of sale.order is confirmed and the draft invoice is created.
> The draft invoice is validated and the payment wizard is used to add a full
> payment. After that the workflow creates the picking for the order. The
> problem is here. The workflow calls sale.order.action_ship_create() and the
> last line of action_ship_create() is a self.write() that triggers the
> workflow to call action_ship_create() once more. This results in duplicate
> stock.pickings created.
>
>
>

--
Ana Juaristi Olalde
Consultor Freelance OpenERP
www.anajuaristi.com
www.openerpsite.com
www.avanzosc.com
677 93 42 59 - 943 85 06 25

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thank you for the feedback.
But, it was really a critical one. I really wonder why you could not meet to this issue.

It has been fixed by revision 2624 <email address hidden>.

You may consider it as an optimization if it could not be reproduced at your end.

Thank you everyone.

Changed in openobject-addons:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.