تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3481 أدوات العرض

This is my report and it's working fine, but if I remove  

<t t-call="web.external_layout" my barcode stop generating. i just have blank line there. I can't use
external_layout because its have logo and other companys information. 
<odoo>
<record model="report.paperformat" id="paperformat_label_inc_report">
<field name="name">paperformat.label.inc.report"</field>
<field name="default" eval="True"/>
<field name="format">custom</field>
<field name="page_height">58</field>
<field name="page_width">30</field>
<field name="orientation">Landscape</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="dpi">90</field>
</record>

<report id="income_rep"
model="stock.move"
string="Print incoming label"
report_type="qweb-pdf"
name="config_trikdis.label_incom_rep"
paperformat="paperformat_label_inc_report"
menu="False"/>


<template id="config_trikdis.report_call_document">
<t t-call="web.external_layout">
<div>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.product_id.default_code, 500, 100)" style="width:500px;height:100px;margin-left: -80px;"/>
<div>
<strong><span t-esc="o.product_id.default_code" style="display: inline-block; width: 100%;font-size:30px;"/></strong>
<span t-esc="o.name" style="display: inline-block; float: left;font-size:30px;"/>
</div>
</div>
</t>
</template>

<template id="config_trikdis.label_incom_rep">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="config_trikdis.report_call_document" t-lang="o.company_id.partner_id.lang"/>
</t>
</t>
</template>
</odoo>


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

The barcode generation will only work if you provide any layout to report. Odoo will not call barcode generation controller without layout.

If you don't want external layout then i suggest you to use web.internal_layout. It will not print any header and footer, you just setup margin padding and setup you page accordingly. 

I have done in lots of report and it will works for me.

I hope it will helpful for you.

Thanks and regards

Haresh Kansara

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يوليو 21
1927
1
يناير 21
9324
6
ديسمبر 20
8454
1
يونيو 20
2427
1
يوليو 19
7589