Commit 1b2cc3c1 by 夏超

[fix] 大东联推送

parent de22f846
...@@ -14,9 +14,8 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -14,9 +14,8 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
@api.model @api.model
def default_get(self, field_names): def default_get(self, field_names):
if self.env.context.get('active_model') != "roke.production.result": results = self.env['roke.production.result'].browse(self.env.context.get('active_ids') or
return super(InheritRokeResultPutWarehouseWizard, self).default_get(field_names) self.env._context.get('active_ids'))
results = self.env['roke.production.result'].browse(self.env.context.get('active_ids'))
system_id = self.env.ref("roke_workstation_sync_ps.roke_workstation_sync_ps_integrate_system") system_id = self.env.ref("roke_workstation_sync_ps.roke_workstation_sync_ps_integrate_system")
sync_address = system_id.sync_address sync_address = system_id.sync_address
sync_port = system_id.sync_port sync_port = system_id.sync_port
...@@ -67,12 +66,15 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel): ...@@ -67,12 +66,15 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
INSERT INTO WBCCB (F_UUID, WBCCB_CPBH, WBCCB_GDBH, WBCCB_CCSL, WBCCB_CCID, WBCCB_RWBH, WBCCB_RWLX, WBCCB_datetime, WBCCB_YGBH, WBCCB_YGMC) INSERT INTO WBCCB (F_UUID, WBCCB_CPBH, WBCCB_GDBH, WBCCB_CCSL, WBCCB_CCID, WBCCB_RWBH, WBCCB_RWLX, WBCCB_datetime, WBCCB_YGBH, WBCCB_YGMC)
VALUES VALUES
""" """
storage_sql = f"""select * from sp_pp_kcrkdj({_uuid})"""
if not insert_sql_data: if not insert_sql_data:
return super(InheritRokeResultPutWarehouseWizard, self).default_get(field_names) return super(InheritRokeResultPutWarehouseWizard, self).default_get(field_names)
sql += " , ".join(insert_sql_data) sql += " , ".join(insert_sql_data)
try: try:
cur.execute(sql) cur.execute(sql)
conn.commit() conn.commit()
cur.execute(storage_sql)
conn.commit()
except Exception as e: except Exception as e:
raise ValidationError("数据上传失败") raise ValidationError("数据上传失败")
finally: finally:
......
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