[FIX] mrp: Fixed Bug 380529: Top Level BOM with Set/Phantom type incorrect behaviour.
bzr revid: uco@tinyerp.com-20100901064519-scqma00dfp5cof7o
This commit is contained in:
parent
d17dc003de
commit
b7b6a70769
|
@ -142,6 +142,9 @@
|
|||
<field name="signal">subflow.done</field>
|
||||
</record>
|
||||
|
||||
<record id="procurement.trans_confirm_confirm_wait" model="workflow.transition">
|
||||
<field name="condition">not test_cancel() and not get_phantom_bom_id()</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -48,6 +48,17 @@ class procurement_order(osv.osv):
|
|||
return False
|
||||
return True
|
||||
|
||||
def get_phantom_bom_id(self, cr, uid, ids, context=None):
|
||||
for procurement in self.browse(cr, uid, ids, context=context):
|
||||
if procurement.move_id and procurement.move_id.product_id.supply_method=='produce' \
|
||||
and procurement.move_id.product_id.procure_method=='make_to_order':
|
||||
phantom_bom_id = self.pool.get('mrp.bom').search(cr, uid, [
|
||||
('product_id', '=', procurement.move_id.product_id.id),
|
||||
('bom_id', '=', False),
|
||||
('type', '=', 'phantom')])
|
||||
return phantom_bom_id
|
||||
return False
|
||||
|
||||
def action_produce_assign_product(self, cr, uid, ids, context={}):
|
||||
""" This is action which call from workflow to assign production order to procurements
|
||||
@return: True
|
||||
|
|
|
@ -694,15 +694,15 @@ class sale_order(osv.osv):
|
|||
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
|
||||
|
||||
val = {}
|
||||
if picking_id:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
|
||||
for proc_id in proc_ids:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr)
|
||||
|
||||
if picking_id:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
|
||||
if order.state == 'shipping_except':
|
||||
val['state'] = 'progress'
|
||||
|
||||
|
|
Loading…
Reference in New Issue