Commit ef07807d by 夏超

[fix] 上推数据修改

parent df6acd27
...@@ -29,18 +29,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -29,18 +29,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
ids_str = [f"'{v.id}'" for v in results] ids_str = [f"'{v.id}'" for v in results]
if not ids_str: if not ids_str:
return super(InheritRokeResultPutWarehouseWizard, self).default_get() return super(InheritRokeResultPutWarehouseWizard, self).default_get()
_logger.info(f"SQL____________{' , '.join(ids_str)}")
sql = f""" sql = f"""
select WBCCB_CCID select WBCCB_CCID
from WBCCB from WBCCB
where WBCCB_CCID not in ({' , '.join(ids_str)}) where WBCCB_CCID in ({' , '.join(ids_str)})
""" """
try: try:
cur.execute(sql) cur.execute(sql)
rows = cur.fetchall() rows = cur.fetchall()
rowdesc = cur.description rowdesc = cur.description
except Exception as e: except Exception as e:
_logger.info(f"SQL____________{sql}")
raise ValidationError("数据库查询失败") raise ValidationError("数据库查询失败")
finally: finally:
cur.close() cur.close()
...@@ -54,7 +52,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -54,7 +52,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
insert_id.append(v.get("WBCCB_CCID", 0)) insert_id.append(v.get("WBCCB_CCID", 0))
insert_sql_data = [] insert_sql_data = []
for v in results: for v in results:
if v.id not in insert_id: if v.id in insert_id:
continue continue
insert_sql_data.append(f""" insert_sql_data.append(f"""
('{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}') ('{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}')
......
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