delivery order with back order (after manual split) is wrongly indicated as shipped (and 100% picked)

Bug #794412 reported by Patrick Amstutz
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Low
OpenERP R&D Addons Team 3

Bug Description

Hey,
When we do a partial picking for a delivery order, if we pick the corresponding original stock.move (the one which is linked to procurement.order), the procurement.order workflow terminates and the picking status of sale order is set to 100%.

This is simply caused by the procurement>action_check_finished>check_move_done function which check the end of procurement.order workflow by looking only at original stock.move, not taking care of back order stock moves.

Here is how to reproduce the bug:

Create a Sale Order, with one order line (CPU1 - 10) from stock. Validate.
In Delivery Order, split the stock move by assigning a production lot > prodlot: A, qty: 3
Process the Delivery Order, and put 0 as a quantity for the prodlot A.
A back order is created for prodlot A.
The other 7 CPU1 are Done.
Go to Sale Order, it is 100% picked. Procurement.order is Done.

We want the picking state to take into account back orders, and therefore the procurement.order should not be Done until all related stock.moves are Done (or cancel).

I use openerp 6.0.2. The behavior should be the same on the trunk version, as the check_move_done function is still the same.

A proposal of correction, taking into account the moves linked to sale order lines instead of moves linked to procurement order is linked as attachment. The case where no sale order is involved (from order point ?) should be analyzed.

Best,
Patrick

Related branches

description: updated
Revision history for this message
Patrick Amstutz (patrick-amstutz) wrote :
Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
status: In Progress → Confirmed
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

I am setting this bug to addons3 team because It should be fix from sale Itself.

Thanks.

Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Revision history for this message
Patrick Amstutz (patrick-amstutz) wrote :

Hey Vinay Rana,

I don't think it is on the sale order side to treat this kind of validation. As this is clear that it is the stock move of the procurement order that is split. Thus it has nothing to do with the sale order itself, but with the procurement order which should check not only the original stock move but all stock moves representing the original stock move before completion.

I would say, why not inverse the relationship between procurement order and stock move?

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello,

I have checked in sale.The procurement order has gone into the done state even when one move is still left to be done.I modified the condition and checked that delivered(boolean) should become True on the basis of (procurement.order = done AND stock.move = done).But the test_state() of sale.order which gets triggered on procurement.order model, wont get called for the move which is yet to be done.

I think the check_move_done() method on procurement.order should check not only the original move assigned on procurement but all the move(s) associated with the original move.

So I request community team to check this bug.

Thanks,
mtr

Changed in openobject-addons:
status: In Progress → Confirmed
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

From The comment I am reassigning this to addons2.

Thanks.

Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Low → Medium
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) wrote :

Hello,

Thanks for Reporting.
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-794412-ron
Revision ID: <email address hidden>
Revision num:4812.

It will be available in trunk soon.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

This creates another problem.
You have to fix the shipped function field. This shipped function field must work on procurement order, not on pickings otherwise it will not work for services.

Changed in openobject-addons:
status: Fix Committed → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello Patrick,

According to given comment on lp bug : https://bugs.launchpad.net/openobject-addons/+bug/796320 currently setting this bug as wishlist becasue this is related bug for this conception problem.

Thanks.

Changed in openobject-addons:
importance: Medium → Wishlist
status: In Progress → Won't Fix
summary: - delivery order with back order is 100% picked
+ delivery order with back order (after manual split) is wrongly indicated
+ as 100% picked
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: delivery order with back order (after manual split) is wrongly indicated as 100% picked

Hi Patrick,

As indicated on your other bug 796320 I think this one needs a workaround right now, as it is a source of mistakes that the user cannot easily detect or fix manually.

Your patch is not correct however, because the procurement module does not depend on the 'sale' module, and should thus not depend on 'sale.order.line' etc. The suggested patch in Rohan's merge proposal was not correct either, namely because it only corrected the 'picked rate' and not the 'shipped' flag, so only partially covered the issue.

I suggest to apply a mix of both as the workaround: we need to correct the workflow test (and thus check_move_done()), but this needs to be done within the sale module, not the procurement module. (I'm reopening the bug so we do that)

Thanks for your well-documented bug reports!

Changed in openobject-addons:
importance: Wishlist → Low
milestone: none → 6.1
status: Won't Fix → Confirmed
summary: delivery order with back order (after manual split) is wrongly indicated
- as 100% picked
+ as shipped (and 100% picked)
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,

According to given comment #10 move this bug to addons3 team.

Thanks.

Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Patrick Amstutz,

Thanks for reporting, the solution of this bug is proposed in
branch lp:~openerp-dev/openobject-addons/trunk-bug-794412-bde
with following Revision ID and Number:

Revision ID: <email address hidden>
Revision Number: 6121

The solution will be merged in main addons soon.

Thanks & Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Resetting status, the proposed fix was incorrect again. For anyone working on this, please *read* comment #10 before trying to implement a fix.

Changed in openobject-addons:
status: Fix Committed → Confirmed
tags: added: backorder
tags: added: partial-delivery
removed: backorder
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.