Skip to content
Permalink
Browse files

[FIX] stock_account: always return a value

4612d50 fixed 9eac6c6 as _run_valuation did not returned any result
4612d50 was 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 #32401

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
  • Loading branch information...
celm1990 authored and mart-e committed Apr 3, 2019
1 parent 3737859 commit f1d0f2ada5e261a4f995f30da4cc0ba1cb4f2215
Showing with 2 additions and 1 deletion.
  1. +2 −1 addons/stock_account/models/stock.py
@@ -321,6 +321,7 @@ def _run_fifo(self, move, quantity=None):

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 @@ def _run_valuation(self, quantity=None):
'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()

0 comments on commit f1d0f2a

Please sign in to comment.
You can’t perform that action at this time.