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
539ae5be22
commit
0b83fa9440
@@ -27,7 +27,8 @@ class StockLocation(models.Model):
|
||||
history = history.sorted(key=lambda r: r.write_date, reverse=True)
|
||||
if history:
|
||||
wh = rec.get_warehouse()
|
||||
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