Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
4547 มุมมอง

I'm wondering how can I display "barcode" field for each invoice line in PDF report in Odoo12 CE?

Any help highly appreciated!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

After adding a column in the invoice lines, try the below code in the report template

<t t-foreach="request.env['product.template'].search([('id', '=', line.product_id.product_tmpl_id)])" t-as="obj">
<td>
<t t-if="obj['barcode']">
<p t-esc="obj['barcode']"/>
</t>
</td>
</t>

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi, 

You can get an example from addons --> product -->report -->product barcode printing.there is an example for product barcode printing.make use of it. or just refer this https://www.odoo.com/apps/modules/11.0/account_report_invoice_barcode/

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

hope this helps

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


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Excuse me, I should have been more precise: I would like to print just the product barcode numerical value (the 13-character number entered in each product details in my case) without any extra images in each invoice line, the same way quantity, price and other fields are displayed on the invoice report. 

อวตาร
ละทิ้ง