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
    • 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
    • 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
    • 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
    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

How to add Attributes to invoice lines

S'inscrire

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

Cette question a été signalée
invoice.linestudioattributes
2 Réponses
437 Vues
Avatar
Luc Bernard

Hi!

Is it possible to add the Product's Attributes to the Order and Invoice lines with Studio, when the Product doesn't have multiple Variants?

F.e. I want it to look like this:

Airpods

Brand: Apple

Type: Headphones

Serialnumber: SNAPAP12345678


Can this be done in Studio without programming in Python?

0
Avatar
Ignorer
Avatar
Alessio Riggio
Meilleure réponse

Short answer: yes for Brand/Type it’s doable 100% in Studio with no Python. For Serial Number, use lots/serial tracking (not attributes). Here’s the clean way:

  1. Model the data on the Product (no variants)
  • Activate “Variants” in Sales/Inventory settings (needed to see Attributes).
  • Go to Products → Configuration → Attributes.
  • Create attributes “Brand” and “Type”.
  • Set “Create variants” = Never (aka “no-variant” attributes). This doesn’t create multiple variants.
  • Open your product → Attributes & Variants tab → assign Brand=Apple, Type=Headphones.
  1. Show attributes on Order/Invoice lines (forms) with Studio
  • Studio → open the Sale Order Line form (model: sale.order.line).
  • Add a new field → choose “Related” → point it to:
    product_id → product_tmpl_id → no-variant attribute values (you’ll find it as a Many2many to product.template.attribute.value; the exact label varies, but search “attribute value”).
  • Widget = many2many_tags, Label = “Attributes”.
  • Repeat the same on the Invoice Line form (model: account.move.line), related to line.product_id.product_tmpl_id → no-variant attribute values.

Result: on each line you’ll see tags like “Brand: Apple”, “Type: Headphones”.

  1. Print them on the PDF (still Studio, no Python)
  • Studio → Reports → Customer Invoice (and/or Quotation/Order).
  • Under each line, add a small block bound to:
    line.product_id.product_tmpl_id.(no-variant attribute values).
  • If the editor doesn’t render a Many2many nicely by default, add a tiny QWeb loop in the visual editor:
    • Insert a “For Each” on line.product_id.product_tmpl_id.no_variant_attribute_value_ids (name may appear as product_template_attribute_value_ids filtered to no-variant).
    • Inside, print t-esc="att.display_name".
      This stays within Studio’s report editor.
  1. Serial Number: don’t model as Attribute
  • If you track serials, use Inventory tracking (Lots/Serials). You assign the serial on the delivery; the invoice can show delivered serials by adding a section under the invoice line that lists the related move lines’ lots (Studio → Reports → add a “for each” on line.move_line_ids / stock move lines → lot_id.name).
  • If you really need to type a serial on the order before delivery, add a simple Char field on sale.order.line (x_serialnumber) with Studio and (optionally) add the same field on account.move.line and copy it over during invoicing (Studio supports copying same-named fields when the invoice is created from the order).

When to choose what

  • Brand/Type: use no-variant attributes (tidy, reusable, visible everywhere).
  • Serial numbers: use Lots/Serials (true traceability). Only use a custom Char if you must pre-capture it on the SO.

Gotchas

  • If you don’t see the “no-variant” option, you haven’t enabled Variants in settings.
  • Related Many2many fields render best with the “tags” widget on forms; for reports, a tiny for-each is usually needed.
  • Avoid making Brand/Type custom Char fields unless you must print them without touching the report attributes keep data consistent across products.

1
Avatar
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

Hi,


Yes, you can add Product Attributes to Order and Invoice lines in Odoo using Studio, even without multiple variants or Python coding. Start by opening Studio in either Sales Orders or Invoices and selecting the appropriate line model (sale.order.line or account.move.line). Add custom character fields for each attribute you want to display, such as "Brand," "Type," and "Serial Number."


Next, convert these fields to Computed fields. This allows them to automatically pull data from the product. Use the formula editor to access the product's attributes, referencing the correct fields on the product.template or product.product model (e.g., record.product_id.x_product_brand). Finally, drag these new fields onto the form view of the Sales Order Line or Invoice Line and, optionally, make them read-only to prevent manual editing. This setup allows you to display product attributes on order and invoice lines using Odoo Studio without any Python code.


Reference:-

* https://www.cybrosys.com/odoo/odoo-books/v17/studio/

* https://www.youtube.com/watch?v=laF9XUPaCc4

* https://www.youtube.com/watch?v=8y5juGg5zHA


Hope it helps

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é
Why is this code don't work ?
studio attributes
Avatar
0
nov. 22
2242
Line invoice - Line tax description
tax invoice.line studio odooV12
Avatar
0
juil. 19
4114
debit and credit in currency
studio
Avatar
Avatar
1
nov. 25
2095
Menu's with different default filter Résolu
studio
Avatar
Avatar
1
juil. 25
2189
Digest mails - any good resources for Studio Résolu
studio
Avatar
Avatar
2
mars 25
2347
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