[FIX]: stock :picking cancels done moves
lp bug: https://launchpad.net/bugs/528320 fixed bzr revid: sbh@tinyerp.com-20100916124412-fjwhh0ms6935f30i
This commit is contained in:
@@ -60,7 +60,6 @@ class stock_journal(osv.osv):
|
||||
}
|
||||
|
||||
stock_journal()
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Stock Location
|
||||
#----------------------------------------------------------
|
||||
@@ -1090,7 +1089,15 @@ class stock_picking(osv.osv):
|
||||
if move.state not in ('cancel',):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def allow_cancel(self, cr, uid, ids, context={}):
|
||||
for pick in self.browse(cr, uid, ids, context=context):
|
||||
if not pick.move_lines:
|
||||
return True
|
||||
for move in pick.move_lines:
|
||||
if move.state == 'done':
|
||||
return False
|
||||
return True
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
if context is None:
|
||||
|
||||
@@ -96,11 +96,13 @@
|
||||
<record id="trans_assigned_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_assigned"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="condition">allow_cancel()</field>
|
||||
<field name="signal">button_cancel</field>
|
||||
</record>
|
||||
<record id="trans_confirmed_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirmed"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="condition">allow_cancel()</field>
|
||||
<field name="signal">button_cancel</field>
|
||||
</record>
|
||||
<record id="trans_draft_cancel" model="workflow.transition">
|
||||
|
||||
Reference in New Issue
Block a user