mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
stock_cycle_count: fix issue with nan while doing the mean calculation
This commit is contained in:
committed by
Lois Rilo
parent
177be5f6bc
commit
6c8d4d0e2c
@@ -32,7 +32,8 @@ class StockLocation(models.Model):
|
||||
if history:
|
||||
wh_id = rec.get_warehouse(rec)
|
||||
wh = self.env['stock.warehouse'].browse(wh_id)
|
||||
if len(history) > wh.counts_for_accuracy_qty:
|
||||
if wh.counts_for_accuracy_qty and \
|
||||
len(history) > wh.counts_for_accuracy_qty:
|
||||
rec.loc_accuracy = mean(
|
||||
history[:wh.counts_for_accuracy_qty].
|
||||
mapped('inventory_accuracy'))
|
||||
|
||||
Reference in New Issue
Block a user