Error: not enough arguments for format string
Code python:
def _getnametahlili(self, user, fromDate, toDate):
sql = " SELECT aaa.name,round(sum(aal.unit_amount)) FROM account_analytic_account as aaa,
account_analytic_line as aal
WHERE aaa.id=aal.account_id and aal.user_id=%d and aal.date BETWEEN \'%s\' AND \'%s\' Group By aaa.name
except
SELECT aaa.name,round(sum(aal.unit_amount)) FROM account_analytic_account as aaa
inner join account_analytic_line as aal on aal.account_id=aaa.id
inner join project_project as pp on pp.analytic_account_id=aal.account_id
WHERE aal.user_id=%d and aal.date BETWEEN \'%s\' AND \'%s\'
Group By aaa.name"
%(user.id, fromDate, toDate)
self.cr.execute(sql)
return self.cr.fetchall()
please Help me…………………………..
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
9743
查看
It looks like your SQL query expects 6 parameters, but it is receiving only 3. Try setting the parameters like this
% (user.id, fromDate, toDate, user.id, fromDate, toDate)