Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    Server5.0实现QR码打印功能

    Odoo 开发与实施交流
    2
    4
    4261
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lihaihe last edited by

      先后试过三种方法:
      1、调用codsoft 的模板文件
      2、在RML报表里通过调用数据库的函数字段(binary),由于在Server5.0.16在循环打印图像时存在BUG,此问题在6.1中才解决,所以放弃了
      3、升级reportlab来支持二维码(最终采用)
      实现方法如下:

      (1)升级reportlab2.2到reportlab2.5
      (2)修改: bin\report\render\rml2pdf\trml2pdf.py代码如下:
                      from reportlab.graphics.barcode import usps
      +                from reportlab.graphics.barcode import createBarcodeDrawing
                  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 = {
      +                'qrcode': lambda x: createBarcodeDrawing('QR', value=x, **args),
                      '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),
      (3)在RML文件中加入如下标签:
      <barCode code="qrcode" x="0.1cm" height="" quiet="0" fontName="Times-Roman"  barWidth="50" barHeight="50" valign="CENTER" alignment="CENTER">[[str(o.ref)]]</barCode>

      1 Reply Last reply Reply Quote 0
      • W
        wangbuke last edited by

        谢谢楼主的热心贡献 ~

        请问下reportlab 的 qrcode 支持中文字符吗?

        谢谢~

        1 Reply Last reply Reply Quote 0
        • L
          lihaihe last edited by

          [quote author=wangbuke link=topic=4291.msg11699#msg11699 date=1344400007]

          请问下reportlab 的 qrcode 支持中文字符吗?

          谢谢~
          [/quote]

          支持中文

          1 Reply Last reply Reply Quote 0
          • First post
            Last post