Printing ean13 not possible

Bug #532559 reported by Laurent Urbain (Realdolmen)
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP's Framework R&D

Bug Description

Hi

I try to print ean13 code so, in trml2pdf.py, i have add two lines to import eanbc from reportlab as the other standard barcodes :

        elif node.tag=='barCode':
            try:
                from reportlab.graphics.barcode import code128
                from reportlab.graphics.barcode import code39
                from reportlab.graphics.barcode import code93
                from reportlab.graphics.barcode import eanbc
                from reportlab.graphics.barcode import common
                from reportlab.graphics.barcode import fourstate
                from reportlab.graphics.barcode import usps
            except Exception, e:
                return None
            args = utils.attr_get(node, [], {'ratio':'float','xdim':'unit','height':'unit','checksum':'int','quiet':'int','width':'unit',
'stop':'bool','bearers':'int','barWidth':'float','barHeight':'float'})
            codes = {
                'codabar': lambda x: common.Codabar(x, **args),
                'code11': lambda x: common.Code11(x, **args),
                'code128': lambda x: code128.Code128(x, **args),
                'standard39': lambda x: code39.Standard39(x, **args),
                'standard93': lambda x: code93.Standard93(x, **args),
                'ean13': lambda x: eanbc.Ean13BarcodeWidget(x, **args),
                'i2of5': lambda x: common.I2of5(x, **args),
                'extended39': lambda x: code39.Extended39(x, **args),
                'extended93': lambda x: code93.Extended93(x, **args),
                'msi': lambda x: common.MSI(x, **args),
                'fim': lambda x: usps.FIM(x, **args),
                'postnet': lambda x: usps.POSTNET(x, **args),
            }
            code = 'code128'
            if node.get('code'):
                code = node.get('code').lower()

 but i have an error :

 File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line 613, in handle_keepWithNext
    while i<n and flowables[i].getKeepWithNext(): i += 1
AttributeError: Ean13BarcodeWidget instance has no attribute 'getKeepWithNext'

I have the version 2.3 of reportlab.

Thks

Laurent

Related branches

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi Laurent

Test my patch. I print ean13 barcodes well.

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi,

I reattach the patch, please check it.

When I writed the other patch I tested it with the ean 1234567890012 and default value in reportlab for this widget is 123456789012 and i didn't see the error, a big coincidence. But now I correct this bug and it works.

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

We Let the Framework team decide.

Thanks.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Triaged
Revision history for this message
xrg (xrg) wrote : Re: [Bug 532559] Re: Printing ean13 not possible

On Thursday 16 December 2010, you wrote:
> We Let the Framework team decide.

It is somewhere in my endless TODO list.
One thing is that I wanted to also write a test case (simple report) for all
the barcodes first.

Revision history for this message
xrg (xrg) wrote :

On Thursday 16 December 2010, you wrote:
> We Let the Framework team decide.
>

Patch waiting in departures lounge, ready to fly for trunk.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Support for EAN13 and QR codes has been merged in revision 3136 revision-id: <email address hidden> (via xrg)
Upgrade to the latest trunk server to be able to use them.
Thanks for reporting!

Changed in openobject-server:
milestone: none → 6.0-rc2
status: Triaged → Fix Released
Revision history for this message
JohnsonHol (bakerjohn910) wrote :
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.