[FIX] stock_location: avoid possible recursion in workflow, plus make source location required for pulled flow

bzr revid: odo@openerp.com-20101015132725-2cwi0tiwb4xbjhmw
This commit is contained in:
Olivier Dony 2010-10-15 15:27:25 +02:00
parent 824042bb1c
commit bb3b2ab637
2 changed files with 2 additions and 4 deletions

View File

@ -42,8 +42,6 @@ class procurement_order(osv.osv):
for procurement in self.browse(cr, uid, ids):
for line in procurement.product_id.flow_pull_ids:
if line.location_id==procurement.location_id:
if not line.location_src_id:
self.write(cr, uid, procurement.id, {'message': _('No source location defined to generate the picking !')})
return (line.type_proc=='move') and (line.location_src_id)
return False

View File

@ -43,7 +43,7 @@
<page string="Logistic Flow">
<field name="flow_pull_ids" editable="bottom" colspan="4" nolabel="1">
<tree string="Pulled flows">
<field name="location_id"/>
<field name="location_id" attrs="{'required': [('type_proc', '=', 'move')]}"/>
<field name="type_proc"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
@ -59,7 +59,7 @@
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<group col="4" colspan="4" attrs="{'invisible':[('type_proc','!=','move')]}">
<field name="location_src_id"/>
<field name="location_src_id" attrs="{'required': [('type_proc', '=', 'move')]}"/>
<field name="picking_type"/>
<field name="partner_address_id"/>
<field name="procure_method"/>