[IMP] Improve code in mrp.py for service type product
bzr revid: jap@tinyerp.com-20130501133229-1kt9kp9aunm5np9l
This commit is contained in:
parent
b4910caba8
commit
0d9dfd54e7
|
@ -774,8 +774,10 @@ class mrp_production(osv.osv):
|
|||
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)]})
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for componant in production.bom_id.bom_lines:
|
||||
if componant.product_id.type == 'service' and not production.move_lines or not production.move_lines2:
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
|
||||
return True
|
||||
|
||||
|
|
|
@ -78,13 +78,6 @@
|
|||
<field name="signal">button_produce</field>
|
||||
</record>
|
||||
|
||||
<record id="prod_trans_done" model="workflow.transition">
|
||||
<field name="act_from" ref="prod_act_ready"/>
|
||||
<field name="act_to" ref="prod_act_done"/>
|
||||
<field name="signal">button_produce_done</field>
|
||||
<field name="condition">test_production_done()</field>
|
||||
</record>
|
||||
|
||||
<record id="prod_trans_in_production_done" model="workflow.transition">
|
||||
<field name="act_from" ref="prod_act_in_production"/>
|
||||
<field name="act_to" ref="prod_act_done"/>
|
||||
|
|
Loading…
Reference in New Issue