[FIX] mrp, mrp_jit, procurement: fix of the procurement order workflow
bzr revid: qdp-launchpad@openerp.com-20121217144136-hen0i0op21f4z1y1
This commit is contained in:
parent
73a9e83274
commit
6c98483d6f
|
@ -136,11 +136,6 @@
|
|||
<field name="signal">subflow.done</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_conf_conf_wait" model="workflow.transition">
|
||||
<field name="act_from" ref="procurement.act_confirm"/>
|
||||
<field name="act_to" ref="procurement.act_confirm_temp"/>
|
||||
<field name="condition">not test_cancel() and not get_phantom_bom_id()</field>
|
||||
</record>
|
||||
<record id="trans_produce_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_produce"/>
|
||||
<field name="act_to" ref="procurement.act_cancel"/>
|
||||
|
|
|
@ -53,7 +53,12 @@ class procurement_order(osv.osv):
|
|||
self.message_post(cr, uid, [procurement.id], body=message, context=context)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def check_conditions_confirm2wait(self, cr, uid, ids):
|
||||
""" condition on the transition to go from 'confirm' activity to 'confirm_wait' activity """
|
||||
res = super(procurement_order, self).check_conditions_confirm2wait(cr, uid, ids)
|
||||
return res and not self.get_phantom_bom_id(cr, uid, ids)
|
||||
|
||||
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' \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
but, this time, without the signal -->
|
||||
<field name="act_from" ref="procurement.act_confirm"/>
|
||||
<field name="act_to" ref="procurement.act_confirm_wait"/>
|
||||
<field name="condition">not test_cancel()</field>
|
||||
<field name="condition">check_conditions_confirm2wait()</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -281,6 +281,10 @@ class procurement_order(osv.osv):
|
|||
"""
|
||||
return False
|
||||
|
||||
def check_conditions_confirm2wait(self, cr, uid, ids):
|
||||
""" condition on the transition to go from 'confirm' activity to 'confirm_wait' activity """
|
||||
return not self.test_cancel(cr, uid, ids)
|
||||
|
||||
def test_cancel(self, cr, uid, ids):
|
||||
""" Tests whether state of move is cancelled or not.
|
||||
@return: True or False
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<field name="name">confirm</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_confirm()</field>
|
||||
<field name="slip_mode">OR</field>
|
||||
</record>
|
||||
<record id="act_confirm_wait" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_procurement"/>
|
||||
|
@ -98,7 +97,7 @@
|
|||
<field name="act_from" ref="act_confirm"/>
|
||||
<field name="act_to" ref="act_confirm_wait"/>
|
||||
<field name="signal">button_check</field>
|
||||
<field name="condition">not test_cancel()</field>
|
||||
<field name="condition">check_conditions_confirm2wait()</field>
|
||||
</record>
|
||||
<record id="trans_confirm_wait_confirm_mto" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirm_wait"/>
|
||||
|
|
Loading…
Reference in New Issue