Odoo Help


How to print an empty RML report?

Juan Formoso
on 11/3/14, 4:42 AM 1,368 views

I am trying to print a RML report (with no data, just generate the document, to start step by step). But by the moment, I was not able to manage it. I created a new module (res_partner_extended), and a new model (res.partner.link.category). In the main folder of my module, I created the file reports.xml, which indicates the reports I created. This is its code:

<?xml version="1.0" encoding="utf-8"?>
        <report auto="True" id="rpe_rplc_history"
        model="res.partner.link.category" name="rpe.rplc_history" 
        string="Selected res.partner.link.category (rplc) lines" />


In the folder reports, I have the next files:

The file with the Python code, rplc_print_history.py:

from report import report_sxw
import time

class res_partner_link_category_history(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context=None):
        super(res_partner_link_category_history, self).__init__(cr, uid, name, context=context)
            'time': time,

  report_sxw.report_sxw('report.rpe.rplc_history', 'res.partner.link.category',
                      parser="res_partner_link_category_history", header="external")

The RML report, res_partner_link_category.rml:

<?xml version="1.0"?>
<document filename="preview_report.pdf">
  <template title="Preview Report" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>

I only want to select lines of the tree view, click Print, then click Selected res.partner.link.category (rplc) lines, and generate a simple report with only the header of the table. But instead of printing the report, I am getting this error:

except_osv: (u"'str' object is not callable", (<type 'exceptions.TypeError'>, TypeError("'str' object is not callable",), <traceback object at 0x7f8844101ab8>))

Can anyone help me, please?

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: 11/3/14, 4:42 AM
Seen: 1368 times
Last updated: 3/16/15, 8:10 AM