dont use deleted products
This commit is contained in:
@@ -63,7 +63,8 @@ async def get_stocks_data(
|
|||||||
SupplierProduct
|
SupplierProduct
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
SupplierProduct.supplier_id.in_(supplier_ids)
|
SupplierProduct.supplier_id.in_(supplier_ids),
|
||||||
|
SupplierProduct.is_deleted == False
|
||||||
)
|
)
|
||||||
.group_by(
|
.group_by(
|
||||||
SupplierProduct.product_id
|
SupplierProduct.product_id
|
||||||
@@ -100,7 +101,8 @@ async def get_stocks_data(
|
|||||||
SupplierProduct
|
SupplierProduct
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
SupplierProduct.supplier_id.in_(supplier_ids)
|
SupplierProduct.supplier_id.in_(supplier_ids),
|
||||||
|
SupplierProduct.is_deleted == False
|
||||||
)
|
)
|
||||||
.group_by(
|
.group_by(
|
||||||
SupplierProduct.product_id
|
SupplierProduct.product_id
|
||||||
@@ -173,7 +175,8 @@ async def get_stocks_data(
|
|||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
SupplierProduct.supplier_id.in_(supplier_ids),
|
SupplierProduct.supplier_id.in_(supplier_ids),
|
||||||
(SupplierProduct.supplier_stock - SupplierProduct.sold_today) > 0
|
(SupplierProduct.supplier_stock - SupplierProduct.sold_today) > 0,
|
||||||
|
SupplierProduct.is_deleted == False
|
||||||
)
|
)
|
||||||
.group_by(
|
.group_by(
|
||||||
SupplierProduct.product_id
|
SupplierProduct.product_id
|
||||||
@@ -198,7 +201,8 @@ async def get_stocks_data(
|
|||||||
.where(
|
.where(
|
||||||
SupplierProduct.supplier_id.in_(
|
SupplierProduct.supplier_id.in_(
|
||||||
supplier_ids
|
supplier_ids
|
||||||
)
|
),
|
||||||
|
SupplierProduct.is_deleted == False
|
||||||
)
|
)
|
||||||
.group_by(
|
.group_by(
|
||||||
ProductRelation.master_product_id
|
ProductRelation.master_product_id
|
||||||
|
|||||||
Reference in New Issue
Block a user