[FIX] procurement: procurement of service product should not go from act_produce_check to act_make_done step.
bzr revid: hmo@tinyerp.com-20111214103144-iadq4ee2gw5fwnhd
This commit is contained in:
parent
1ca40d12ff
commit
e5129e0316
|
@ -154,11 +154,16 @@ class procurement_order(osv.osv):
|
|||
return {'value': v}
|
||||
return {}
|
||||
|
||||
def check_product(self, cr, uid, ids):
|
||||
def check_product(self, cr, uid, ids, context=None):
|
||||
""" Checks product type.
|
||||
@return: True or False
|
||||
"""
|
||||
return all(procurement.product_id.type in ('product', 'consu') for procurement in self.browse(cr, uid, ids))
|
||||
res = False
|
||||
for procurement in self.browse(cr, uid, ids, context=context):
|
||||
product = procurement.product_id
|
||||
if product.type in ('product', 'consu'):
|
||||
res = True
|
||||
return res
|
||||
|
||||
def check_move_cancel(self, cr, uid, ids, context=None):
|
||||
""" Checks if move is cancelled or not.
|
||||
|
|
|
@ -183,6 +183,7 @@
|
|||
<record id="trans_produce_make_done" model="workflow.transition">
|
||||
<field name="act_from" ref="act_produce_check"/>
|
||||
<field name="act_to" ref="procurement.act_make_done"/>
|
||||
<field name="condition">check_product()</field>
|
||||
</record>
|
||||
<record id="trans_produce_service_make_done" model="workflow.transition">
|
||||
<field name="act_from" ref="act_produce_service"/>
|
||||
|
|
Loading…
Reference in New Issue