Commit 6615c3c0 by 夏超

[fix] 上推数据修改

parent 367abafd
import pymssql import pymssql
import logging
from odoo import models, fields, api, _ from odoo import models, fields, api, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
# 修正数量 # 修正数量
...@@ -28,14 +30,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -28,14 +30,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
if not ids: if not ids:
return super(InheritRokeResultPutWarehouseWizard, self).default_get() return super(InheritRokeResultPutWarehouseWizard, self).default_get()
try: try:
cur.execute(f""" sql = f"""
select WBCCB_CCID select WBCCB_CCID
from WBCCB from WBCCB
where WBCCB_CCID not in ('{"', '".join(ids)}') where WBCCB_CCID not in ('{"', '".join(ids)}')
""") """
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()
...@@ -65,6 +69,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -65,6 +69,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
cur.execute(sql) cur.execute(sql)
conn.commit() conn.commit()
except Exception as e: except Exception as e:
_logger.info(f"SQL____________{sql}")
raise ValidationError("数据库查询失败") raise ValidationError("数据库查询失败")
finally: finally:
cur.close() cur.close()
......
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