Selling a product with phantom BOM ignores chained locations and procurement gets stuck
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Addons Team 2 | ||
5.0 |
Confirmed
|
Undecided
|
Unassigned |
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.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 381 lines (+264/-22)5 files modifiedmrp/mrp.py (+6/-7)
mrp/mrp_demo.xml (+2/-15)
mrp_jit/test/mrp_jit_test.xml (+108/-0)
product/product_demo.xml (+2/-0)
sale/test/sale_test.xml (+146/-0)
- Rucha (Open ERP) (community): Approve
- qdp (OpenERP): Pending requested
-
Diff: 14 lines (+2/-1)1 file modifiedmrp/stock.py (+2/-1)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | In Progress → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |
just for info: i saw a bug similar few times ago in the trunk and it should be fixed there.