That's why I wrote that this issue must be reviewed by a stock move expert.
I'm adding a screencast to reproduce. After seeing this screencast: ======================= As you can see in that case, OpenERP will never try to buy PRODUCT_ITEM_A. If you want to know why it's so easy to reproduce, it's because PRODUCT_ITEM_B don't have any stock so the internal picking list of the manufacturing order stay in "Waiting Availability" : PTN/XXXX (confirmed: Waiting Availability) Move n: PRODUCT_ITEM_A : stock - > stock (assigned: Available) Move n: PRODUCT_ITEM_B : stock - > stock (waiting: Waiting Another Move) MO/XXXX (confirmed: Awaiting Raw Materials) Move n+1: PRODUCT_ITEM_A : stock - > production (waiting: Waiting Another Move) Move n+1: PRODUCT_ITEM_B : stock - > production (waiting: Waiting Another Move) So, again, the problem comes from _product_reserve (stock/stock.py), it should decrease value if a move (location_id=location_dest_id) is assigned and it's move_dest_id is waiting (location_id<>location_dest_id) and this recursively. ** Attachment added: "lp_1169074.ogv" https://bugs.launchpad.net/openobject-addons/+bug/1152616/+attachment/3742626/+files/lp_1169074.ogv ** Changed in: openobject-addons Status: Incomplete => 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/1152616 Title: [6.1][7.0][trunk] _product_reserve result is not correct Status in OpenERP Addons (modules): New Bug description: _product_reserve (stock/stock.py) does not take linked moved into account for computation. It results in a total mess when using mrp module as a "mrp.production" object when confirmed will always create two moves (the first for the procurement, and a second one that is in a 'waiting' state and attached to the stock.picking list used to check production start availability) for each product line: "Stock -> Stock" linked to "Stock -> Production" via "move_dest_id" field The BIG problem is that "_product_reserve" is doing this: Counted value INCREASED (++) for : location_id <> stock AND location_dest_id = stock AND state='done' Counted value DECREASED (--) for : location_id == stock AND location_dest_id <> stock AND state in ('done', 'assigned') As you can see, the first move will never be taken into account, even if assigned because "location_id == location_dest_id" and the second move is also ignored because it is in a 'waiting' state. In practice, the final issue is that a product procurement is always valid (if Quantity On Hand > 0.0): "from stock: products assigned." but the quantity is permanently decreased without exception from procurement. So actually, the MRP module cannot be used. To manage notifications about this bug go to: https://bugs.launchpad.net/openobject-addons/+bug/1152616/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~openerp-india Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-india More help : https://help.launchpad.net/ListHelp

