Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4458 มุมมอง

Hi I'm trying to import lines from a CSV, but I can't handle type errors.
For example, if you insert a line in a datetime field, I get this error in the create:

psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block

Despite handling errors with

try:
  my_module.create ()
exception Except:
  pass

  How can I check the values before I get to create or at least handle the error and take other actions. For the moment if I insert a field that is not present on a selection, I manage with try catch but I can't for data types

อวตาร
ละทิ้ง

override create method and check the field

ผู้เขียน

@Sehrish And? This is the question. How do I check the type of field where I am going to write the value?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 24
1506
0
ก.พ. 23
1881
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14789
0
ต.ค. 23
33
3
ต.ค. 23
788