parent
8810c2b5bb
commit
e0f5685507
|
@ -542,7 +542,6 @@ class stock_picking(osv.osv):
|
|||
|
||||
def test_finnished(self, cr, uid, ids):
|
||||
move_ids=self.pool.get('stock.move').search(cr,uid,[('picking_id','in',ids)])
|
||||
|
||||
for move in self.pool.get('stock.move').browse(cr,uid,move_ids):
|
||||
if move.state not in ('done','cancel') :
|
||||
if move.product_qty != 0.0:
|
||||
|
@ -763,6 +762,14 @@ class stock_picking(osv.osv):
|
|||
}, context=context)
|
||||
return res
|
||||
|
||||
def test_cancel(self,cr, uid, ids, context={}):
|
||||
for pick in self.browse(cr, uid, ids, context=context):
|
||||
if not pick.move_lines:
|
||||
return False
|
||||
for move in pick.move_lines:
|
||||
if move.state not in ('cancel',):
|
||||
return False
|
||||
return True
|
||||
stock_picking()
|
||||
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
<record id="stock_location_stock" model="stock.location">
|
||||
<field name="name">Stock</field>
|
||||
<field name="location_id" ref="stock_location_company"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -33,28 +33,23 @@
|
|||
<record id="stock_location_13" model="stock.location">
|
||||
<field name="name">Stock Level 1</field>
|
||||
<field name="location_id" ref="stock_location_stock"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_14" model="stock.location">
|
||||
<field name="name">Finished products</field>
|
||||
<field name="location_id" ref="stock_location_13"/>
|
||||
<field model="account.account" name="account_id" search="[('name','=','Merchandise Type B')]"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_15" model="stock.location">
|
||||
<field name="name">Sub Products</field>
|
||||
<field name="location_id" ref="stock_location_13"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_workshop" model="stock.location">
|
||||
<field name="name">Workshop</field>
|
||||
<field name="location_id" ref="stock_location_stock"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="stock_location_components" model="stock.location">
|
||||
<field name="name">Components</field>
|
||||
<field name="location_id" ref="stock_location_workshop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -94,6 +94,16 @@
|
|||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">button_cancel</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="trans_assigned_cancel_auto" model="workflow.transition">
|
||||
<field name="act_from" ref="act_assigned"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="condition">test_cancel()</field>
|
||||
</record>
|
||||
<record id="trans_confirmed_cancel_auto" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirmed"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="condition">test_cancel()</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue