Fixed Production Planning Tool

This commit is contained in:
Neil Trini Lasrado 2016-03-16 15:26:01 +05:30
parent fc827b329e
commit 41380dfad8

View File

@ -135,8 +135,7 @@ class ProductionPlanningTool(Document):
from `tabSales Order Item` so_item
where parent in (%s) and docstatus = 1 and qty > delivered_qty
and exists (select * from `tabItem` item where item.name=so_item.item_code
and (item.is_pro_applicable = 1
or item.is_sub_contracted_item = 1)) %s""" % \
and item.is_pro_applicable = 1) %s""" % \
(", ".join(["%s"] * len(so_list)), item_condition), tuple(so_list), as_dict=1)
if self.fg_item:
@ -150,8 +149,7 @@ class ProductionPlanningTool(Document):
and pi.parent_item = so_item.item_code
and so_item.parent in (%s) and so_item.qty > so_item.delivered_qty
and exists (select * from `tabItem` item where item.name=pi.item_code
and (item.is_pro_applicable = 1
or item.is_sub_contracted_item = 1)) %s""" % \
and item.is_pro_applicable = 1) %s""" % \
(", ".join(["%s"] * len(so_list)), item_condition), tuple(so_list), as_dict=1)
self.add_items(items + packed_items)
@ -171,8 +169,7 @@ class ProductionPlanningTool(Document):
from `tabMaterial Request Item` mr_item
where parent in (%s) and docstatus = 1 and qty > ordered_qty
and exists (select * from `tabItem` item where item.name=mr_item.item_code
and (item.is_pro_applicable = 1
or item.is_sub_contracted_item = 1)) %s""" % \
and item.is_pro_applicable = 1) %s""" % \
(", ".join(["%s"] * len(mr_list)), item_condition), tuple(mr_list), as_dict=1)
self.add_items(items)