請教DataError: invalid input syntax for integer: "False"是何原因
-
我寫了一個wizard要直接將資料寫入purchase_order,purchase_order_line
但執行時發生DataError: invalid input syntax for integer: "False"的錯誤視窗
自認SQL語句無誤 請教是何原因造成 如何解決??
感恩
Code:
[size=10pt]cr.execute("""INSERT INTO purchase_order(create_uid, create_date, write_date, write_uid, origin, partner_address_id, warehouse_id, partner_ref, date_order, location_id, amount_untaxed, name, shipped, partner_id, notes, company_id, amount_tax, invoice_method, state, validator, minimum_planned_date, pricelist_id, amount_total) values('1','"""+DT+"""','"""+DT+"""','1','','"""+S_ADD_ID+"""','1','','"""+date_purchase+"""','12',"""+amount_untaxed+""",'"""+pord_name+"""',TRUE,'"""+supply_id+"""','','1',0.00,'order','draft','1','"""+minimum_planned_date+"""','2',"""+amount_total+""")""")
cr.execute("""INSERT INTO purchase_order_line(create_uid, create_date, write_date, write_uid, product_uom, order_id, price_unit, product_qty, partner_id, invoiced, name, date_planned, notes, company_id, state, product_id) values('1','"""+DT+"""','"""+DT+"""','1','"""+UOM_ID+"""','"""+PO_ID+"""','"""+str(price_unit_purchase)+"""','"""+str(product_qty)+"""','"""+supply_id+"""',TRUE,'"""+PRO_NAME+"""','"""+date_purchase+"""','','1','draft','"""+product_name+"""')""")[/size]