Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to add Attributes to invoice lines

Subscribe

Get notified when there's activity on this post

This question has been flagged
invoice.linestudioattributes
2 Replies
425 Views
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
Discard
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
Discard
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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Why is this code don't work ?
studio attributes
Avatar
0
Nov 22
2241
Line invoice - Line tax description
tax invoice.line studio odooV12
Avatar
0
Jul 19
4110
debit and credit in currency
studio
Avatar
Avatar
1
Nov 25
2091
Menu's with different default filter Solved
studio
Avatar
Avatar
1
Jul 25
2182
Digest mails - any good resources for Studio Solved
studio
Avatar
Avatar
2
Mar 25
2341
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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