[v6]Production Order does not link traceability info when Finished Product is split in Production Lots

Bug #928263 reported by Simon
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team
credativ-openerp
New
Undecided
Unassigned

Bug Description

When you split the Finished Products line of a Manufacturing Order, using two Production Lots, the stock moves of the consumed products are not linked to all the Finished Product lines, therefore if you open the upstream traceability of the different production lots, the moves of the consumed products will only be visible on one production lot.

Steps to reproduce:

* using trunk server and addons, modules stock and mrp installed with demo data
* create a new Manufacturing Order for product pc2, set product qty to 2
* confirm production
* on the tab finished product, open the line for pc2, and use the split button next to production lot
* in the split in lots window, enter pl1 and pl2 each with quantity 1 under Production Lot Numbers
* Manufacturing Order: Force reservation, start production, produce
* Under Warehouse / Traceability / Production Lots, open the "upstream traceability" of pl1 and pl2,
you will see one with the consumed products attached, and one without

(for the upstream traceability screen to work, you have to remove the type:'' from the context of this button in the stock.production.lot.form form, see bug: https://bugs.launchpad.net/bugs/928233)

Possible solution:

There is code to handle this situation in mrp/mrp.py under action_produce. The relevant lines are:

        for raw_product in production.move_lines2:
            new_parent_ids = []
            parent_move_ids = [x.id for x in raw_product.move_history_ids]
            for final_product in production.move_created_ids2:
                if final_product.id not in parent_move_ids:
                    new_parent_ids.append(final_product.id)
            for new_parent_id in new_parent_ids:
                stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})

but at this point the move_lines2 does not yet contain the consumed lines. adding a line:

        production = self.browse(cr, uid, production.id)

right before this loop fixes the problem.

Tags: maintenance

Related branches

Amit Parik (amit-parik)
summary: - Production Order does not link traceability info when Finished Product
- is split in Production Lots
+ [v6]Production Order does not link traceability info when Finished
+ Product is split in Production Lots
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Fabian Semal (fabian.semal) wrote :

Hello,

Any news on this bug ? Is it fixed in some rev ?

Thank you

tags: added: maintenance
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Simon,

This issue has been fixed in lp:~openerp-dev/openobject-addons/6.0-opw-582072-skh with,

Revision ID: <email address hidden>
Rev-no: 5377

This branch is under the review of our experts and will be merged soon into the stable 6.0.

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Leigh Willard (leigh) wrote :

This bug is still present in version 7. Also, if more than 1 raw materials are used in a production order, only the first is ever shown in the Upstream Traceability.

When will this fix come out? It has been a year and a half since it was reported!

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.