Odoo Help

Welcome!

This community 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.

0

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

By
sama
on 1/30/16, 1:18 AM 541 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)

self.cr.execute(sql)

return self.cr.fetchall()


report.rml:

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

<tr>

<td>

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

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

</td>

<td>

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

</td>

</tr>

</blockTable> 






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

0

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

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.....

sama
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/30/16, 1:18 AM
Seen: 541 times
Last updated: 1/30/16, 6:42 AM