Skip to content

Commit

Permalink
[15.0][FIX] stock_voucher: error de division por cero al calcular el …
Browse files Browse the repository at this point in the history
…valor declarado al cambiar el tipo de operacion
  • Loading branch information
juanpgarza committed Sep 26, 2024
1 parent 1ad6bda commit 061dc21
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions stock_voucher/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,16 @@ def _compute_declared_value(self):
picking_avg.append((
move.product_uom_qty / bom_quantity))
done_avg.append((move.quantity_done / bom_quantity))
picking_value += so_bom_line.price_reduce_taxexcl * (
sum(picking_avg) / len(picking_avg))
done_value += so_bom_line.price_reduce_taxexcl * (
sum(done_avg) / len(done_avg))
if len(picking_avg) == 0:
picking_value += so_bom_line.price_reduce_taxexcl
else:
picking_value += so_bom_line.price_reduce_taxexcl * (
sum(picking_avg) / len(picking_avg))
if len(done_avg) == 0:
done_value += so_bom_line.price_reduce_taxexcl
else:
done_value += so_bom_line.price_reduce_taxexcl * (
sum(done_avg) / len(done_avg))

declared_value = picking_value if inmediate_transfer\
else done_value
Expand Down

0 comments on commit 061dc21

Please sign in to comment.