Hello odoo community Im just wondering whats wrong in this sql statement while using operator "in" and variable from odoo.
Code Example:
sql="select sum(debit-credit) from account_account_period_sum where period_id in ({0}) and account_id = {1}".format (','.join(map(str,per_ids)), account_id)
When im trying to install module im getting :
ProgrammingError: syntax error at or near ")"
LINE 1: ...om account_account_period_sum where period_id in () and acco...
it seems like variable didnt get past when in ()
Thank you
per_ids2=[1,2,3]
sql="select sum(debit-credit) from account_account_period_sum where period_id in ({0}) and account_id = {1}".format (per_ids2, account_id)
ProgrammingError: syntax error at or near "["
LINE 1: ...om account_account_period_sum where period_id in ([1, 2, 3])...
--
Darius Martinkus | Zeraxis Limited
E: darius.martinkus@zeraxis.com
M: 07450292546 | T: 020 8253 8015
This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Zeraxis Limited. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error please contact the sender.