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

Bug trying to remove a table cell using removeParentNode

By
Phil74
on 4/3/13, 11:33 AM 3,153 views

I use OpenOffice Writer 3.4.1 to design my own quotation/order report. From there, I generate the rml file and send to server as per the procedure. I have a test installation running on windows and a production installation running on Ubuntu.

For the sake of testing, I have created a small table with 5 cells. In the middle one I have added the formula:

[[ removeParentNode('para') ]]

When I generate the pdf file from OpenERP, it works fine and the cell is empty.

If I change the formula in order to suppress the cell:

[[ removeParentNode('td') ]]

I get an error message on the production server only:

type 'exceptions.AssertionError'>, AssertionError(), <traceback object at 0x7ff5750bff38

But I don't get the error message on the windows installation.

I have restarted the openerp server but it hasn't changed anything. I know I am using the latest version of my rml file as I can see the various testing phases. I have sent the report to both servers.

Here is the what the log says specifically for this problem:

2013-04-03 13:11:00,733 1621 ERROR ? openerp.service.web_services: Exception: 
Traceback (most recent call last):

  File "/home/download/openerp-6.1-20121008-233119/openerp/service/web_services.py", line 727, in go
(result, format) = obj.create(cr, uid, ids, datas, context)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/report_sxw.py", line 442, in create
fnct_ret = fnct(cr, uid, ids, data, report_xml, context)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/report_sxw.py", line 511, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/report_sxw.py", line 533, in create_single_pdf
pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/interface.py", line 207, in create_pdf
obj.render()

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/render.py", line 59, in render
self._result = self._render()

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml.py", line 41, in _render
return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 1007, in parseNode
r.render(fp)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 314, in render
pt_obj.render(el)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 983, in render
fis += r.render(node_story)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 877, in render
return process_story(node_story)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 870, in process_story
flow = self._flowable(node)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 793, in _flowable
return  self._table(node)

  File "/home/download/openerp-6.1-20121008-233119/openerp/report/render/rml2pdf/trml2pdf.py", line 697, in _table
assert length == len(node.get('colWidths').split(','))
AssertionError

2013-04-03 13:11:00,882 1621 ERROR ? openerp.netsvc: 
(<type 'exceptions.AssertionError'>, AssertionError(), <traceback object at 0x7ff5750bff38)

So if anyone has an idea out there, it will be most welcome!

Had the same problem, because there might be a function returning bool value (true and false). OpenERP can return TRUE but cannot return FALSE. Instead, it returns nothing causing error.

Solved problem by returning strings 'yes' and 'no'.

For example: [[ (is_girl() == 'yes' or removeParentNode('tr') ]]

Jevgeni
on 10/17/13, 5:54 AM

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

0 follower(s)

Stats

Asked: 4/3/13, 11:33 AM
Seen: 3153 times
Last updated: 3/16/15, 8:10 AM