← Back to team overview

openerp-india team mailing list archive

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

 

Public bug reported:

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: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/928263

Title:
  Production Order does not link traceability info when Finished Product
  is split in Production Lots

Status in OpenERP Addons (modules):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/928263/+subscriptions


Follow ups

References