【问题标题】:Bar code on POS receipt odoo 10POS 收据 odoo 10 上的条形码
【发布时间】:2017-09-11 18:44:42
【问题描述】:

我尝试在 pos 收据上打印条形码/二维码。但它不起作用?

<t t-jquery='.pos-center-align' t-operation='after'>
    <div class="pos-center-align barcode">
      <barcode encoding="CODE39">*123456798*</barcode>// It print *123456798*
      <img t-att-src="'/report/barcode/QR/%s' % (order.name)"/>
      <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s'%('QR', 'text', 200, 200)"/>
    </div>
  </t>

我该怎么做?

输出:

【问题讨论】:

    标签: openerp odoo-10


    【解决方案1】:

    尝试使用 EAN13 类型的条形码,因为这适用于我的情况。我还从“Receipt Ref”中获取了价值,您可以从后端视图中找到:Point of Sale >> Orders >> Extra Info 在 xml 中,您需要这样编写:

    XML 文件:

    <img t-if="o.pos_reference" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=%s' % ('Code128', o.pos_reference.split(' ')[1], 600, 100, 1)" style="width:300px;height:50px"/></div>
    

    通过这种方式,我可以在收据上打印条形码。可能对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 1970-01-01
      • 2018-09-20
      • 2020-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多