Print lists gives a "LayoutError: Flowable <Paragraph at (...) frame=column>(...) too large on page 2"

Bug #326146 reported by Numérigraphe
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Undecided
Unassigned

Bug Description

On the current trunk, whe I load a list view, press the print button and select "print screen", I get an exception.
For exemple if I try to print the list of employees :
Traceback (most recent call last):
  File "/home/ls/Logiciels/openerp-trunk/server/bin/service/web_services.py", line 585, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/printscreen/ps_list.py", line 76, in create
    res = self._create_table(uid, datas['ids'], result['fields'], fields_order, rows, context, model_desc)
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/printscreen/ps_list.py", line 217, in _create_table
    self.obj.render()
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/render/render.py", line 50, in render
    result = self._render()
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/render/rml.py", line 36, in _render
    return rml2pdf.parseString(self.xml, images=self.bin_datas, path=self.path,title=self.title)
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/render/rml2pdf/trml2pdf.py", line 803, in parseString
    r.render(fp)
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/render/rml2pdf/trml2pdf.py", line 226, in render
    pt_obj.render(self.dom.documentElement.getElementsByTagName('story'))
  File "/home/ls/Logiciels/openerp-trunk/server/bin/report/render/rml2pdf/trml2pdf.py", line 792, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 740, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 671, in handle_flowable
    raise LayoutError(ident)
LayoutError: Flowable <Paragraph at 0x950e4ac frame=column>Employee too large on page 2

Same problem on attendance, and probably any other pbject using the generic report.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

It works fine for me, it may be due to your version of reportlab ?

Is it with demo data ? Did you tested on latest trunk ?

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Numérigraphe (numerigraphe) wrote :

I'm using trunk server revno 1706, addons revno 2198, reportlab 2.1 on Ubuntu 8.04 Hardy.
Sorry I don't have any other setup at hand for the moment.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

FYI, same problem with server 1711 and a fresh database with demo data.
Is anybody else using Ubuntu Hardy having this ?

Revision history for this message
avv33 (avv33) wrote :
Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Where is the bug exactly ?

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

I have the same problem with 5.0.0-2 tar.gz under ubuntu Hardy (8.04) LTS

Use a database with service profile and demo.

Click on Print in Toolbar and select "Print Screen", i have the problem with french (not test with english)

Revision history for this message
avv33 (avv33) wrote :

I have specially created a new demo database in English. Have the same error.

Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote : Re: [Bug 326146] Re: Print lists gives a "LayoutError: Flowable <Paragraph at (...) frame=column>(...) too large on page 2"

avv33 wrote:
> I have specially created a new demo database in English. Have the same
> error.
>

It's a problem with the version of reportlab shipped with hardy.

--
Christophe Simonis
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://openerp.com
Blog: http://christophe-simonis-at-tiny.blogspot.com

Tiny ERP - The Powerful Open Source ERP
  -- Jules Jogerpo, 2006

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

I confirm, I don't have this bug with the last version of reportlab ( >= 2.1) on Intrepid

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I'll try to backport it to Hardy and tell you whether it fixes the problem.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I backported the package "python-reportlab" from intrepid on my hardy workstation, but it doesn't fix the problem.
Same with the package from jaunty (reportlab 2.2).

Maybe one of the dependencies of reportlab ? Or a configuration file ?

Any idea ?

Revision history for this message
avv33 (avv33) wrote :

I have specially downloaded & installed the latest official release http://www.reportlab.org/ftp/ReportLab_2_3.tar.gz, but no changes, error still present. OS - Mandriva 2008.0, Python 2.5.1

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

The problem appear with AllInOne in Win XP

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Eric Vernichon (eric-vernichon) wrote :

I have the same problem with jaunty and intrepid

Reportlab version 2.3 and 2.1

Revision history for this message
avv33 (avv33) wrote :

May be this bug from incorrectly handling Unicode strings?
After replace fonts in reports as described here - http://openobject.com/wiki/index.php/Developers:Developper's_Book/Reports/ReportsUnicode, most of reportlab reports works fine, excluding something like printscreen and product cost structure.
I tried replace report folder with code from version 4.2.3.3 and I get error:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Maybe, with the new code of reports, we simply don't see the reason of errors?

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

I found the problem (It's not a reportlab problem), it's the same as DMS when server use a non english locale

Execute these commands in the terminal before launch the server
 LANG=en_US.UTF-8
 export LANG
 ./openerp-server.py ...

and go to Partner->Partner-> Print (toolbar) ->print screen (It Works ;) )

To reproduce the problem, in the terminal (add fr_FR.UTF-8 to your system if you want to test)
 LANG=fr_FR.UTF-8
 export LANG
 ./openerp-server.py ....

Revision history for this message
Numérigraphe (numerigraphe) wrote :

It works indeed if I launch the server with LANG=C. That's an acceptable workaround, thanks Christophe.

Revision history for this message
avv33 (avv33) wrote :

Hi.
I tried this workaround, but in my case export LANG=en_US.UTF-8 or LANG=C does not result. Only with export LC_ALL=C printscreen and related reports worked ok. Therefore I add the following lines in /bin/report/printscreen/__init__.py (based on AMit's patch from https://bugs.launchpad.net/openobject-server/+bug/322432):
# locale.resetlocale is bugged with some locales.
# we need to normalize the result of locale.getdefaultlocale()
import locale
try:
    locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale())))
except:
    locale.setlocale(locale.LC_ALL, 'C')

My server OS config: Mandriva 2008.0, LANG=ru_RU.UTF-8. Client - GTK on WinXP SP2 rus.
Now all reports works ok. Thanks to all.

Revision history for this message
Michel (mich-redground) wrote :

Hello,

is there any solution for windows server and client?
As I have the Win-AllInOne-Package with python included, it seems to be not so easy to resolve this issue?

Thank you,
Michel

Revision history for this message
vir (Open ERP) (vir-tinyerp) wrote :

hi

The problem is with version of all in one. This bug is solved in the latest sources. So please wait till next release of version of all in one. or use the sources from the launchpad.

Thank you

vir (Open ERP)

nel (nel-tinyerp)
Changed in openobject-addons:
status: New → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Savyn Vydelingum (savyn-publicus-solutions) wrote :

Hi,
We are getting same problem on Windows 2003 Server, with OpenERP V5.0.0 Server. IS there a fix for Windows based os.
Thanks

Revision history for this message
Michel (mich-redground) wrote :

If I put the lines (reported as fix here: https://bugs.launchpad.net/bugs/326146 ):

<code>
# locale.resetlocale is bugged with some locales.
# we need to normalize the result of locale.getdefaultlocale()
import locale
try:
   locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale())))
except:
   locale.setlocale(locale.LC_ALL, 'C')

</code>

Into: Server\addons\base\__init__.py

Print screen works...

Changed in openobject-addons:
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.