Commit 47915a43 by 夏超

[fix] 上推领料单数据修改

parent adee026f
...@@ -99,7 +99,7 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking): ...@@ -99,7 +99,7 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
for v in line_data: for v in line_data:
product = http.request.env["roke.product"].sudo().search([("id", "=", v.get("material_id", 0))]) product = http.request.env["roke.product"].sudo().search([("id", "=", v.get("material_id", 0))])
task_id = http.request.env["roke.production.task"].sudo().search([("id", "=", v.get("task_id", 0))]) task_id = http.request.env["roke.production.task"].sudo().search([("id", "=", v.get("task_id", 0))])
task_id_dict.append({ task_id_list.append({
"material_code": product.code or "", "material_code": product.code or "",
"code": task_id.code or "", "code": task_id.code or "",
"qty": v.get("qty", 0), "qty": v.get("qty", 0),
...@@ -170,7 +170,7 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking): ...@@ -170,7 +170,7 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
VALUES VALUES
""" """
sql_list = [] sql_list = []
for v in task_id_dict: for v in task_id_list:
sql_list.append(f""" sql_list.append(f"""
('{v.get("code", "")}', '{v.get("material_code", "")}', {v.get("demand_qty", 0)}, {v.get("qty", 0)}, '{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}') ('{v.get("code", "")}', '{v.get("material_code", "")}', {v.get("demand_qty", 0)}, {v.get("qty", 0)}, '{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}')
""") """)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment