← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 700154] Re: Selling a product with phantom BOM ignores chained locations and procurement gets stuck

 

just for info: i saw a bug similar few times ago in the trunk and it
should be fixed there.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/700154

Title:
  Selling a product with phantom BOM ignores chained locations and
  procurement gets stuck

Status in OpenObject Addons Modules:
  New

Bug description:
  I'm testing this bug on version 5.0.15 running on Ubuntu 10.04.

  When you add a product to a sales order and that product has a phantom
  bill of materials (BOM), there are two problems: the stock moves for
  the component products ignore any chained locations that should affect
  them, and the procurement for the main product never gets marked as
  complete. This means that the sales order never gets marked as
  shipped.

  I will attach a merge proposal that includes a test for this bug, but here are detailed steps to reproduce the problem:
  1. Create a new database with the sample data included. Choose the Manufacturing Industry profile. Leave the rest as defaults and don't add any extra modules.
  2. Configure a product with a phantom BOM that you can sell. I used PC0. Change the product's supply method to "make to order" instead of "make to stock". Go to the bill of materials and change the BOM type to Sets / Phantom, and also . There's also an extra bill of materials that points to the PC0 product but is named RAM on demand. It appears to be a mistake, so just delete it. Make sure to save changes on both screens.
  3. Create a sales order to the Agrolait customer. Add a line with the phantom product (PC0).
  4. Confirm the sales order and remember the order reference.
  5. Go to the Stock Management: Outgoing Products screen. Double click on the packing list for your order reference.
  6. You should see three stock moves: KEYA, MOU, and PC1. Click the Check Availability button and they should all become available.
  7. Click the Packing Done button and Make Picking and Close. The packing list should now be done.
  8. Go to the Stock Management: Delivery Orders screen. Look for a packing list for your order reference.

  Expected behaviour:
  There should be a delivery order for your order reference, and it should have three stock moves for the same three products as the packing list from the Outgoing Products screen. When you ship that delivery order and reload the sales order, it should be marked as picked. This is the behaviour you will see if you sell products that don't have phantom BOM's.

  Actual behaviour:
  There is no delivery order for your order reference. The sales order isn't marked as picked, even though you've shipped the only packing list there is. If you go and look at the PC0 procurement order, you'll see that it's still waiting.

  Analysis:
  There are two problems here: the code that explodes the BOM doesn't call action_confirm on the stock moves it creates, and it doesn't link those stock moves to the original PC0 stock move with move_dest_id. All of this code is in the mrp module's StockMove._action_explode() method. Calling action_confirm is what generates the delivery order. If you don't linking to the PC0 stock move with move_dest_id, then it never gets marked as done and the procurement gets stuck.





References