Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

How To Modify Master Product Barcode Template in Qweb?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
productinventorybarcode
3 Besvarelser
12907 Visninger
Avatar
Altela

Does anyone know how to modify barcode template via Qweb?
I found the barcode report template for master product named as report_producttemplatebarcode. When printing to pdf, the problem is it prints as the whole page and now i would like to change the size and table of it so hopefully it will match with the sticker when printing using our barcode printer. This code below is the default barcode template from report_producttemplatebarcode Qweb :

<?xml version="1.0"?>
<t t-name="product.report_producttemplatebarcode">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="template">
<t t-foreach="template.product_variant_ids" t-as="product">
<t t-call="product.report_simple_barcode">
<t t-set="product" t-value="product"/>
</t>
</t>
</t>
</div>
</t>
</t>

I previously add <style> but nothing works.
Please advice, thank you

0
Avatar
Kassér
Avatar
Avinash Nk
Bedste svar

Hi,

Please try in this template. report_simple_barcode

<template id="report_simple_barcode">
<div style="width: 32%; display: inline-table; height: 10rem;">
<table class="table table-bordered mb-0" style="border: 2px solid black;">
<tr>
<th class="table-active text-left" style="height: 4rem;">
<strong t-field="product.display_name"/>
</th>
</tr>
<tr>
<td class="text-center align-middle" style="height: 6rem;">
<t t-if="product.barcode">
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:4rem;"/>
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:4rem;"/>
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:4rem"/>
<span t-field="product.barcode"/>
</t>
<t t-else=""><span class="text-muted">No barcode available</span></t>
</td>
</tr>
</table>
</div>
</template>


Change the styles in the highlighted code as per your need.

Thanks

1
Avatar
Kassér
Altela
Forfatter

Dear Avinash,

Thank you for your feedback. It worked like a charm.

For future reference, i head to settings > technical > views, and then search report_simple_barcode. Then, i edit some code just like Avinash suggest.

Thank you friend!

Altela
Forfatter

Ohh and yes, one more thing,

Just for future reference, to make print preview show exactly like my barcode paper, i head to settings > technical > Reports, and then type in search Product Barcode. Then i edit paper format to be just like my barcode template size, so it will print as should be.

Avatar
Max
Bedste svar

Hello! i am new to odoo. And as a task at my job i need to fix a problem with the display after scanning. explanation: when i use the scanner "honeywell" which has a screen to display the information after scanning, the page that contains the information of the scan doesn't fit the screen. we have been trying other gagdet with a bigger resolution  (such as a tablet) to display the information after scaning and the page still doesn't fit the screen. every time after scanning we need to zoom out so the page could fit the screen and we do not want it like that, we would like the pages to fully display at the screen so the entire page would be visible without any zoom out or zoom in. Please help! 

0
Avatar
Kassér
Avatar
Sanjeev Kumar
Bedste svar

Hi,

I am trying to increase the width of the barcode (just the barcode). As I change the code, it increases the width however it goes beyond the boundaries of the label as I am unable to align the barcode to the left.

0
Avatar
Kassér
Altela
Forfatter

Hi Sanjeev,
Based on the code posted by Avinash above, try to change the "align-middle" to "align-left", or maybe just delete it instead.

to increase or decrease the barcode, try to reduce the style="width:100% to some numbers you find it fit.

Don't hesitate to tell back the result

Sanjeev Kumar

Thanks for the Reply Altela,
I tried the solution but it does not work. Wish I could post the picture here.

Sanjeev Kumar

I can increase or decrease the width however I can not align it to left or change its position at all.

Altela
Forfatter

Could you put your code here please? maybe i can try to reproduce your issue and figure it out from my machine

Sanjeev Kumar

<t t-name="product.report_simple_barcode">
<div style="width: 100%; display: inline-table; height: 4rem;">
<table class="table table-bordered mb-0" style="border: 2px solid black;">
<tr>
<th class="table-active text-left" style="height: 4rem;">
<strong t-field="product.display_name"/>
</th>
</tr>
<tr>
<td class="text-center align-left" style="height: 4rem;">
<t t-if="product.barcode">
Total Parts
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', quote_plus(product.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', quote_plus(product.barcode or ''), 600, 150)" style="width:105%;height:6rem"/>
<span t-field="product.barcode"/>
</t>
<t t-else=""><span class="text-muted">No barcode available</span></t>
</td>
</tr>
</table>
</div>
</t>

Altela
Forfatter

Sanjev,
I successfully reproduce your problem in my machine, it's seems like there are no error but you are not configure your barcode paper report yet so it prints to a large paper size (mostly in A4 size as i already tested).

Since the answer is a bit long, i put a step-by-step on my blog. Here's the link, https://www.projectflakes.com/2022/04/how-to-customize-your-odoo-barcode.html

You might skipping the step number 3 here, please tell me the result after you done the steps

Sanjeev Kumar

Appreciate your help Altela.
I have configured my label correctly and its fits on the label I am using 55X50. My issue is the barcode. The width of the barcode is squeezed due to the label size so the scanner I am using can not scan it. If I try to increase the width of the barcode it doesn't fit on the label because the barcode placed in the centre and I am unable to align it to the left.
If it makes sense.

Altela
Forfatter

Understood,
In my previous experience I too had the same old problem where i tried to shrink the "barcode box" width but somehow it cannot be scanned using barcode scanner too. The farthest things i can achieve customizing barcode box is only reducing it's height, but not the width.

Since i cannot shrink it for customization in views, i played around with the output report and gladly it working good for my case. I also need a bit customization when printing it out with Google Chrome, by setting the "Scale" value to "Default" so it can be scanned.

Maybe you can try this one with chrome, as my last suggestion since i don't have any further troubleshot ideas XD

https://drive.google.com/file/d/1oOEtlRaVvtceCCvO5tztgGtkbiwZ-jvF/view?usp=sharing

Sanjeev Kumar

Thanks for the suggestion. I will keep playing with it to see if it works, somehow.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Use USB Barcode Scanner to update inventory on each product (Odoo 16 Community)
inventory barcode
Avatar
Avatar
1
jun. 25
2303
Issue with Return Location in Transfer
product inventory
Avatar
Avatar
1
mar. 25
2724
How to cancel a completed receipt and delete related products Løst
product inventory
Avatar
Avatar
1
feb. 25
4139
product name not changed for all users Løst
product inventory
Avatar
Avatar
2
feb. 25
2666
Create products from take apart a purchased product
product inventory
Avatar
Avatar
1
mar. 24
2095
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now