首页 > 解决方案 > 条码不显示

问题描述

<template id="report_label">
            <t t-call="report.html_container">
                <t t-foreach="docs" t-as="o">
                    <div class="page">
                        <div class="row">
                            <div class="example_class">
                                <t t-esc="o.name" />
                                <t t-esc="o.type" />
                                <p>Size: <span t-esc="o.calculate_size()"/></p>
                                <p>Color: <span t-esc ="o.calculate_color()" /></p>
                                <p>Price: </p>
                                <tr><td colspan="2"><img t-att-src="'/report/barcode/Code128/%s' % 'test-0001'" style="width:100%;height:25px"/>          </td></tr>
                            </div>
                        </div>
                    </div>
                </t>
            </t>
        </template>

在此处输入图像描述 这是我的模板,由于某种原因,条形码没有显示出来。

如果我在http://localhost:8069/report/barcode/Code128/test-0001中进行测试,那么它会返回一个条形码。

并且还安装了reportlab。

结果相同,但边界更小

<img t-if="o.barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' %('Code128',o.barcode,250,50)"/>

标签: odooodoo-10

解决方案


是设置>系统参数需要更改

Key report.url
Value   http://0.0.0.0:8069

推荐阅读