Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Real Estate
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

How To Modify Master Product Barcode Template in Qweb?

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
productinventorybarcode
3 Відповіді
12892 Переглядів
Аватар
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
Аватар
Відмінити
Аватар
Avinash Nk
Найкраща відповідь

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
Аватар
Відмінити
Altela
Автор

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
Автор

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.

Аватар
Max
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Sanjeev Kumar
Найкраща відповідь

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
Аватар
Відмінити
Altela
Автор

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
Автор

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
Автор

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
Автор

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!

Реєстрація
Related Posts Відповіді Переглядів Дія
Use USB Barcode Scanner to update inventory on each product (Odoo 16 Community)
inventory barcode
Аватар
Аватар
1
черв. 25
2295
Issue with Return Location in Transfer
product inventory
Аватар
Аватар
1
бер. 25
2721
How to cancel a completed receipt and delete related products Вирішено
product inventory
Аватар
Аватар
1
лют. 25
4132
product name not changed for all users Вирішено
product inventory
Аватар
Аватар
2
лют. 25
2661
Create products from take apart a purchased product
product inventory
Аватар
Аватар
1
бер. 24
2090
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

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