The cancellation of move should not compute cost price

because such move can not be done (prevented by _deny_modify_done_cancel).

issue4107
review11421002
This commit is contained in:
Cédric Krier
2014-08-29 16:21:21 +02:00
parent a9e8434711
commit f04e44c681
+1 -16
View File
@@ -632,22 +632,7 @@ class Move(Workflow, ModelSQL, ModelView):
@ModelView.button
@Workflow.transition('cancel')
def cancel(cls, moves):
pool = Pool()
Date = pool.get('ir.date')
today = Date.today()
for move in moves:
move.effective_date = today
if (move.from_location.type in ('supplier', 'production')
and move.to_location.type == 'storage'
and move.product.cost_price_method == 'average'):
move._update_product_cost_price('out')
elif (move.to_location.type == 'supplier'
and move.from_location.type == 'storage'
and move.product.cost_price_method == 'average'):
move._update_product_cost_price('in')
move.effective_date = None
move.save()
pass
@classmethod
def create(cls, vlist):