Printing ean13 not possible

Asked by Laurent Urbain (Realdolmen)

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'

Does anyone have an idea to help me?

Thks

Laurent

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello laurent0,

The error comes from reportlab code so the new standard which you did import in code is not support by reportlab.
May be you need to check reportlab version which is not compatible with eanbc.

Hope this will help you.

Thanks.

Revision history for this message
Laurent Urbain (Realdolmen) (laurent-urbain) said :
#2

Hello,

Thanks for your answer and sorry for my bad english. :)

I have the version 2.3 of reportlab, and there is the file eanbc.py.
So I suppose my reportlab version is compatible with eanbc.

I don't find any forum about reportlab to show my error?

Thanks

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#3

Hello laurent0,

You can post bug for this issue.If this is problem from openERP code then it will be fixed .

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Laurent Urbain (Realdolmen) for more information if necessary.

To post a message you must log in.