Odoo Help


Error: not enough arguments for format string

on 8/3/15, 3:51 AM 1,958 views

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
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)
  return self.cr.fetchall()

please Help me…………………………..


Timo Talvitie, Vizucom Oy

--Timo Talvitie, Vizucom Oy--
| 5 4 7
Tampere, Finland
--Timo Talvitie, Vizucom Oy--

Lead developer at Vizucom.

Timo Talvitie, Vizucom Oy
On 8/3/15, 5:43 AM

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)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/3/15, 3:51 AM
Seen: 1958 times
Last updated: 8/3/15, 5:49 AM