← Back to team overview

credativ team mailing list archive

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

 

You have been subscribed to a public bug by Dmitrijs Ledkovs (credativ) (dle-credativ):

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.

** Affects: credativ-openerp
     Importance: Undecided
         Status: New

** Affects: openobject-addons
     Importance: Low
     Assignee: OpenERP Publisher's Warranty Team (openerp-opw)
         Status: Confirmed

-- 
[v6]Production Order does not link traceability info when Finished Product is split in Production Lots
https://bugs.launchpad.net/bugs/928263
You received this bug notification because you are a member of credativ, which is subscribed to the bug report.