Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    • Referral Program
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Use of QR Codes and Barcodes in PDF's

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
pdfreportsqrcode
1 Répondre
1217 Vues
Avatar
Ian Gennaro Guitron Sagaon (iggs)

Hello community, does anyone knows if Odoo has a way to use QR codes in PDF documents? I need to use generate some information in my QR code related to data in the PDF.

0
Avatar
Ignorer
Avatar
Ian Gennaro Guitron Sagaon (iggs)
Auteur Meilleure réponse

Odoo allows the creation of a QR-type image that is fed with information from the database (dynamic fields), similar to how we fill a PDF document with various dynamic fields. To achieve this, we will use the Studio application and the PDF editor (specifically the “QWeb”). Follow these steps:

  • Access the PDF report you want to edit using Studio (for this example, we will use a new document).





  • Once the new document or the document to edit is ready, use the "</> Edit Sources" function.



  • Now we will insert code to create the QR image we need:

  • 💡

    Remember that when inserting elements, we must follow best practices by using the web.studio view and the corresponding xpath.


  • <img t-att-src="'/report/barcode/QR/%s' % (doc.partner_id.name)"/>

This code is represented as follows:

  • With the code written, you will be able to see the QR code information, but not in the desired format. To fix this, use the following extension:
  • <img t-att-src="'/report/barcode/QR/%s' % (doc.partner_id.name)" style="width:120px;height:120px"/>

  • The result of the code is the next one:


  • If you need to include more information, you must use connectors within the parentheses of the code.

    • Use the connector "+" to add more fields.
    • You can keep adding as many fields as needed.
✅

PRO TIP:

Remember to keep simple the information, when using more than 200 characters the QR becomes difficult to be read. If you need to use more than this amount of characters, we recommend to use a link to access the information from the QR.



  • When scanned, the result will be:



  • If you want the information to appear separated, you can include separators within the code to improve readability.


  • Quotation marks allow you to define spaces, separators, or text characters. The result will look like this:



  • ⚠️
    If an error appears when saving the information: 
    Add spaces between elements inside single quotes 
    Example: ' / ', ' Folio ', etc.
  • Once all elements and fields have been configured, you can finish editing the document, and it will update according to the information entered in the system.
❌
It is very important that when implementing these configurations, we remind that there are laws and regulations protecting personal data, which is considered restricted.

Some examples of this are: SSN, RFC, internal ID's, personal emails, bank accounts and more. 

For more information, visit: Personal and Sensitive Information

BARCODES

For barcodes, the process is similar. However, keep in mind:

  • Barcodes can only store a single alphanumeric value (as in the Inventory application).
💡
There are several types of barcodes, the common ones are the next ones:
  • CODE128 (most common in Odoo) [USE THIS FOR DOCUMENTS]

    • Flexible (Complete ASCII)
    • 20 - 30 characters (optimal length)
  • EAN13

    • 13 characters
    • For retail products
  • CODE39

    • A-Z, 0-9, and some symbols
    • If is more 

To insert a barcode into a PDF document, follow the same steps but use the following code:

<div t-field="doc.name" t-options="{'widget': 'barcode', 'width': 400, 'height': 100}"/>

It is a text field rendered visually as a barcode using a widget.

💡
It could also be done as: 

<img t-att-src="'/report/barcode/Code128/%s' % doc.name"/>

The final result will look like this:

GENERAL RECOMMENDATIONS

Next, here are some recommendations to take in consideration about using this tipe of functions in Odoo:

  • The recommended minimal size to use is:

    • QR: 2x2 cm [Ideal= 3 - 4cm]
    • Barcode: height = 1 cm [quiet zone is mandatory]
  • When positioning the QR or Barcode is important to avoid borders of the document and fold areas (if printed).
  • Try to keep a good contrast to help the lecture of the code (white background and solid black text).
⚠️
REMEMBER TO TEST THE CODE: Print it, scan it with several devices and test different sizes to confirm that the information works.

More information

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
PDF report name isn't respected when using module from app store
pdf reports
Avatar
0
sept. 21
5050
PDF reports show negative amounts with vertical bar "|" instead of "-". How can I fix this.?
pdf reports
Avatar
Avatar
1
mai 18
5920
No css format on PDF reports after upgrade Odoo Server 10.0-20170119 ! (no headers) Résolu
pdf reports
Avatar
Avatar
2
janv. 17
8934
Reports not auto-saved to attachments Résolu
pdf reports
Avatar
Avatar
Avatar
3
mars 15
9714
Add Customer Name to Printed Reports Name Résolu
pdf reports 17.2
Avatar
Avatar
Avatar
2
oct. 24
4350
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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