[FIX] stock_account: always return a value
4612d50baefixed9eac6c6377as _run_valuation did not returned any result4612d50baewas however returning a value only in one case Move the return statement to alaways return value_to_return, whatever the state of the move closes odoo/odoo#32401 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
committed by
Martin Trigaux
parent
37378592db
commit
f1d0f2ada5
@@ -321,6 +321,7 @@ class StockMove(models.Model):
|
||||
|
||||
def _run_valuation(self, quantity=None):
|
||||
self.ensure_one()
|
||||
value_to_return = 0
|
||||
if self._is_in():
|
||||
valued_move_lines = self.move_line_ids.filtered(lambda ml: not ml.location_id._should_be_valued() and ml.location_dest_id._should_be_valued() and not ml.owner_id)
|
||||
valued_quantity = 0
|
||||
@@ -378,7 +379,7 @@ class StockMove(models.Model):
|
||||
'value': value_to_return,
|
||||
'price_unit': price_unit if self._is_dropshipped() else -price_unit,
|
||||
})
|
||||
return value_to_return
|
||||
return value_to_return
|
||||
|
||||
def _action_done(self):
|
||||
self.product_price_update_before_done()
|
||||
|
||||
Reference in New Issue
Block a user