fix stock dashboard
This commit is contained in:
parent
933671252c
commit
b5eade4f10
|
|
@ -55,8 +55,7 @@ class SamashtiDashboard(models.AbstractModel):
|
|||
COALESCE(SUM(CASE
|
||||
WHEN sm.date BETWEEN {fromDate} AND {toDate}
|
||||
AND sl_dest.usage = 'internal'
|
||||
AND sl_src.usage in ('supplier','inventory') THEN sm.product_uom_qty * (uom.factor /sm_uom.factor)
|
||||
WHEN sm.date BETWEEN {fromDate} AND {toDate} AND (sl_src.usage = 'inventory' OR sl_dest.usage = 'inventory') THEN sm.product_uom_qty * (uom.factor /sm_uom.factor)
|
||||
AND sl_src.usage = 'supplier' THEN sm.product_uom_qty * (uom.factor /sm_uom.factor)
|
||||
ELSE 0
|
||||
END), 0) AS receipts,
|
||||
|
||||
|
|
@ -64,7 +63,7 @@ class SamashtiDashboard(models.AbstractModel):
|
|||
COALESCE(SUM(CASE
|
||||
WHEN sm.date BETWEEN {fromDate} AND {toDate}
|
||||
AND sl_dest.usage = 'internal'
|
||||
AND sl_src.usage = 'production' THEN sm.product_uom_qty * (uom.factor /sm_uom.factor)
|
||||
AND sl_src.usage = 'production' THEN sm.product_uom_qty * (uom.factor /sm_uom.factor) AND sm.production_id IS NOT NULL
|
||||
ELSE 0
|
||||
END), 0) AS production,
|
||||
|
||||
|
|
@ -72,7 +71,7 @@ class SamashtiDashboard(models.AbstractModel):
|
|||
COALESCE(SUM(CASE
|
||||
WHEN sm.date BETWEEN {fromDate} AND {toDate}
|
||||
AND sl_src.usage = 'internal'
|
||||
AND sl_dest.usage = 'production' THEN sm.product_uom_qty * (uom.factor /sm_uom.factor)
|
||||
AND sl_dest.usage = 'production' THEN sm.product_uom_qty * (uom.factor /sm_uom.factor) AND sm.production_id IS NOT NULL
|
||||
ELSE 0
|
||||
END), 0) AS consumption,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue