Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to add Attributes to invoice lines

Subscriure's

Get notified when there's activity on this post

This question has been flagged
invoice.linestudioattributes
2 Respostes
424 Vistes
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
Descartar
Avatar
Alessio Riggio
Best Answer

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
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
Why is this code don't work ?
studio attributes
Avatar
0
de nov. 22
2241
Line invoice - Line tax description
tax invoice.line studio odooV12
Avatar
0
de jul. 19
4110
debit and credit in currency
studio
Avatar
Avatar
1
de nov. 25
2090
Menu's with different default filter Solved
studio
Avatar
Avatar
1
de jul. 25
2182
Digest mails - any good resources for Studio Solved
studio
Avatar
Avatar
2
de març 25
2341
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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