Odoo Help


in rml report: when output function is null,i has error?

on 1/30/16, 1:18 AM 864 views

    def _function(self, fromDate, toDate):

sql = "select * from \

(select (sum(aml.credit)-sum(aml.debit)) as s,rp.name \

from account_move_line as aml \

join res_partner as rp on aml.partner_id=rp.id \

where aml.account_id=200 and aml.date BETWEEN \'%s\' AND \'%s\' \

group by rp.name order by s desc) as f " %(fromDate, toDate)


return self.cr.fetchall()


    <blockTable colWidths="181.0,216.0" style="Table36">



<para style="P8">[[ repeatIn(function(data['form']['fromDate'], data['form']['toDate']),'ol') ]]</para>

<para style="P9">[[ol[0] ]]</para>



<para style="P9">[[ol[1] ]]</para>




How do I fix this error code؟؟؟؟؟؟؟؟؟

Axel Mendoza
On 1/30/16, 6:42 AM

You need to check if you have something to return and if not then you could return an empty list to do the trick like:

return self.cr.fetchall() or []

thanks,but i has error: TypeError: cannot concatenate 'str' and 'tuple' objects please help me.....

on 1/30/16, 7:24 AM

It's a good practice to post all your error log to get helped

Axel Mendoza
on 1/30/16, 1:47 PM

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: 1/30/16, 1:18 AM
Seen: 864 times
Last updated: 1/30/16, 6:42 AM