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
    • Validations
    • 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
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all 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
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    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

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
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

Modifying the ZPL Labels

S'inscrire

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

Cette question a été signalée
printinglabelszpl
2 Réponses
2265 Vues
Avatar
Chad Huskey

In Odoo we are attempting to show information from the associated delivery ticket/sale order in Product Label (ZPL) found in Settings / Technical / Actions / Reports. 


We would like to display the customer's name, sales order number, sales order date, and the description of each item on the label. 


The product name was already a part of the label, but we can't find the way to pull the other fields from the delivery ticket when printing ZPL labels.


So we need to figure out what to add to the code to do this.  We've tried everything we can think of.


The current code in its QWeb view (label_product_product_view) is the following:

```

<t t-name="stock.label_product_pr oduct_view">

    <t t-foreach="quantity.items()" t-as="barcode_and_qty_by_produ ct">

        <t t-set="product" t-value="barcode_and_qty_by_pr oduct[0]"/>

        <t t-foreach="barcode_and_qty_by_ product[1]" t-as="product_info">

            <t t-set="barcode" t-value="product_info['barcode ']"/>

            <t t-set="currency_id" t-value="pricelist.currency_id or product.currency_id"/>

            <t t-foreach="range(product_info[ 'quantity'])" t-as="qty">

                <t t-translation="off">

^XA


^FX Second section with recipient address and permit information.

^CFJ,250

^FO50,100^FD<t t-out="product_info['display_n ame_markup']"/>^FS


^XZ

                </t>

            </t>

        </t>

    </t>

</t>

0
Avatar
Ignorer
Avatar
Cédric Paradis
Meilleure réponse

I've had to do something similar and it required creating a new label, since the product label has no reference to the picking when printed. You'll need to create a label for stock.picking and then iterate over the products/move lines in the transfer.

From the transfer, you'll be able to pull the contact (res.partner) info since it has a One2Many relationship to the contact.

I've made an ASN label in the past which takes a delivery order and prints a zpl label for each move line (so each product + lot combination) with some contact info. It shows how to tell the printer to start a new label and how to go over each product in a stock.picking

<t t-name="stock.label_ASN_template_view">
    <t t-foreach="docs" t-as="transfer">
        <t t-set="contact_name" t-value="transfer.partner_id.commercial_company_name"/>
        <t t-set="contact_street" t-value="transfer.partner_id.street"/>
        <t t-set="contact_city" t-value="transfer.partner_id.city"/>
        <t t-set="contact_zip" t-value="transfer.partner_id.zip"/>
        <t t-set="contact_state" t-value="transfer.partner_id.state_id.code"/>
        <t t-set="contact_country" t-value="transfer.partner_id.country_code"/>
        <t t-set="carrier" t-value="transfer.x_studio_transporteur"/>
        <t t-set="PO" t-value="transfer.sale_id.client_order_ref"/>
        <t t-translations="off">
            <t t-foreach="transfer.move_ids" t-as="move">
                <t t-foreach="move.move_line_ids" t-as="line">
           
^XACI28

^FX Border Definitions
^FX From field
^FO2,4
^GB254,203,2
^FS

^FX To field
^FO254,4
^GB558,203,2
^FS

^FX Postal Code field
^FO2,203
^GB508,206,2
^FS

^FX Carrier info field
^FO508,203
^GB304,206,2
^FS

^FX Product info field
^FO2,409
^GB812,406,2
^FS

^FX MAN Segment field
^FO2,815
^GB812,403,2
^FS

^FX Data definitions
^FX From field
^FO10,16
^A0N,26,26^FB200,1^FDFrom/DE:
^FS

^FO20,50
^A0N,26,26^FB225,5^FDImpress Foods Inc. 1910 rue du Sanctuaire, Quebec, QC G1E 3L2
^FS

^FX To field
^FO264,16
^A0N,26,26^FB200,1^FDTo/A:
^FS

^FO284,50
^A0N,26,26^FB300,5^FD<t t-out="contact_name"/>. <t t-out="contact_street"/>, <t t-out="contact_city"/>, <t t-out="contact_state"/> <t t-out="contact_zip"/>
^FS

^FX Postal code field
^FO10,213
^A0N,26,26^FB500,1^FDShip to Postal Code:
^FS

^FO15,243
^A0N,26,26^FB500,1^FD(420)<t t-out="contact_zip"/>
^FS

^FO90,288
^BCN,100,N,N,Y^FD420<t t-out="contact_zip"/>
^FS

^FX Carrier Field
^FO518,213
^A0N,26,26^FB500,1^FDCarrier:
^FS

^FO518,243
^A0N,26,26^FB500,1^FD<t t-out="carrier"/>
^FS

^FO518,273
^A0N,26,26^FB500,1^FDPro: 12345
^FS

^FO518,303
^A0N,26,26^FB500,1^FDB/L: 123456789
^FS

^FX Product Field
^FO20,439
^A0N,40,40^FB500,1^FDPO: <t t-out="PO"/>
^FS

^FO20,489
^A0N,40,40^FB500,1^FDGTIN: <t t-out="line.product_barcode"/>
^FS

^FO500,489
^A0N,40,40^FB500,1^FDLOT: <t t-out="line.lot_id.display_name"/>
^FS

^FO20,539
^A0N,40,40^FB800,2^FDItem Description: <t t-raw="line.product_id.display_name"/>
^FS

^FO130,639
^A0N,40,40^FB800,1^FDCase QTY: <t t-out="line.quantity"/>
^FS

^FO130,689
^A0N,40,40^FB800,1^FDProduct Net Weight (KG):
^FS

^FO130,739
^A0N,40,40^FB800,1^FDCode Date: <t t-esc="line.lot_id.use_date.strftime('%Y-%m-%d')"/>
^FS

^FX MAN Segment
^FO10,822
^A0N,26,26^FB500,1^FDMAN Segment (SSCC-18):
^FS
^FO110,900
^BCN,225,Y,Y,Y,A^FD(00)003001234000000001

^XZ
                </t>
            </t>
        </t>
    </t>
</t>
0
Avatar
Ignorer
Avatar
Chad Huskey
Auteur Meilleure réponse

Just to clarify, we're printing from the delivery ticked so the sales order number would be the Source Document field.

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é
how to print product labels on a Zebra LP2824 PLUS?
printing labels
Avatar
Avatar
Avatar
2
août 24
8160
Problem printing labels
labels zpl IoT
Avatar
Avatar
1
août 24
2250
How to print lot labels based on quantity received with different UoMs
printing labels Lot/SN
Avatar
0
févr. 24
1617
Automatically priniting of shipping connector labels
printing shipping labels
Avatar
0
janv. 20
366
how to print several labels per product?
product printing labels
Avatar
0
mars 15
4368
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
  • Devenez 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 ภาษาไทย 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