【发布时间】:2017-09-23 02:10:25
【问题描述】:
我正在尝试扩展销售点、模板以修改网络票和印刷版......我想放置一个 id 为 numbe 的代码栏。但是阅读和测试我的代码不起作用......为了测试目的,我在模板的几个部分中放置了一个文本以观察它是否被修改......但事实并非如此。
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-extend="XmlReceipt">
<t t-jquery=".receipt-change" t-operation="inner">
<div><span>hello world</span></div>
</t>
</t>
<t t-extend="PosTicket">
<t t-jquery=".receipt-orderlines .product_line" t-operation="inner">
<div><span>hello world</span></div>
</t>
</t>
<t t-extend="PaymentScreenWidget">
<t t-jquery="div.pos-payment-container" t-operation="inner">
<div>
Payment Screen Modified
</div>
</t>
</t>
</templates>
此代码位于文件名 pos.xml 中,我将其从 openerp.py 中附加如下:
'qweb': ['static/src/xml/pos.xml'],
为什么 XmlReceipt 或 PosTicket 或支付模板没有扩展???? 然后当我成功扩展模板时,我会尝试用
替换 hello world<barcode encoding="CODE128"><t t-esc="o.id"/></barcode>
谢谢!
[编辑] 好的,现在我正在扩展模板,但是我无法从 order.sequence_number 生成条形码
我正在尝试这样:
<img class="img-responsive" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', order.sequence_number, 500, 100)" style="width:250px;height:50px;"/>
条形码不是这样生成的......但如果我这样做,它就是
<img t-att-src="'/report/barcode/Code128/*mycode*'" style="width:250px;height:50px;"/>
所以我认为错误在于字符串渲染.....
【问题讨论】:
-
您想在 XmlReceipt 或 PostTicekt 中添加条形码?
标签: openerp odoo-9 qwebview qweb