Fix: Voucher Update would not filter out Zero quantity inventories.

This commit is contained in:
Amritanshu Agrawal 2021-06-19 08:19:48 +05:30
parent 7cf6775ea1
commit d14250c0c7
2 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,7 @@ def do_save(
item.kots.append(kot)
db.add(kot)
for index, i in enumerate(k.inventories):
if i.quantity == 0:
if round(i.quantity, 2) == 0:
continue
total_quantity = round(
sum(inv.quantity for ko in data.kots for inv in ko.inventories if inv.product.id_ == i.product.id_),

View File

@ -110,6 +110,8 @@ def update_route(
item.kots.append(kot)
db.add(kot)
for index, i in enumerate(k.inventories):
if round(i.quantity, 2) == 0:
continue
product: ProductVersion = db.execute(
select(ProductVersion).where(
and_(