Commit ef07807d by 夏超

[fix] 上推数据修改

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