[fix] escape fg_item in production planning's get_so_items
This commit is contained in:
parent
da7d1667d5
commit
08b39b1ff8
@ -128,7 +128,7 @@ class ProductionPlanningTool(Document):
|
|||||||
|
|
||||||
item_condition = ""
|
item_condition = ""
|
||||||
if self.fg_item:
|
if self.fg_item:
|
||||||
item_condition = ' and so_item.item_code = "' + self.fg_item + '"'
|
item_condition = ' and so_item.item_code = "{0}"'.format(frappe.db.escape(self.fg_item))
|
||||||
|
|
||||||
items = frappe.db.sql("""select distinct parent, item_code, warehouse,
|
items = frappe.db.sql("""select distinct parent, item_code, warehouse,
|
||||||
(qty - delivered_qty) as pending_qty
|
(qty - delivered_qty) as pending_qty
|
||||||
@ -139,7 +139,7 @@ class ProductionPlanningTool(Document):
|
|||||||
(", ".join(["%s"] * len(so_list)), item_condition), tuple(so_list), as_dict=1)
|
(", ".join(["%s"] * len(so_list)), item_condition), tuple(so_list), as_dict=1)
|
||||||
|
|
||||||
if self.fg_item:
|
if self.fg_item:
|
||||||
item_condition = ' and pi.item_code = "' + self.fg_item + '"'
|
item_condition = ' and pi.item_code = "{0}"'.format(frappe.db.escape(self.fg_item))
|
||||||
|
|
||||||
packed_items = frappe.db.sql("""select distinct pi.parent, pi.item_code, pi.warehouse as warehouse,
|
packed_items = frappe.db.sql("""select distinct pi.parent, pi.item_code, pi.warehouse as warehouse,
|
||||||
(((so_item.qty - so_item.delivered_qty) * pi.qty) / so_item.qty)
|
(((so_item.qty - so_item.delivered_qty) * pi.qty) / so_item.qty)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user