[FIX] stock_account: SVL for consumable

Stock Valuation Layers are used for the MRP Cost Analysis feature.
Therefore, they are useful for consumable.

opw-2412668

closes odoo/odoo#63404

X-original-commit: c68e572f7c6f5109f1bfc40f9a44fc051f315112
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-12-15 14:28:17 +00:00
parent e56e573dd9
commit 9e1849d183
+1 -1
View File
@@ -234,7 +234,7 @@ class StockMove(models.Model):
# Init a dict that will group the moves by valuation type, according to `move._is_valued_type`.
valued_moves = {valued_type: self.env['stock.move'] for valued_type in self._get_valued_types()}
for move in self:
if float_is_zero(move.quantity_done, precision_rounding=move.product_uom.rounding) or move.product_id.type == 'consu':
if float_is_zero(move.quantity_done, precision_rounding=move.product_uom.rounding):
continue
for valued_type in self._get_valued_types():
if getattr(move, '_is_%s' % valued_type)():