Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

How to remove product description from invoice lines?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
invoiceodoov18
2 Răspunsuri
2997 Vizualizări
Imagine profil
Nico

Hello Odoo Community,

I’m facing an issue with invoice lines where the product description is displayed by default, both in the backend and on PDF invoices. This makes the invoices and the order lines extremely cluttered and hard to read, and it’s not the desired behavior. What I want is for only the product name, internal reference, and variant to be displayed—without the product description.

Currently, in the invoice template, the product name is rendered using:

<td name="account_invoice_line_name"><span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}">Bacon Burger</span></td>

However, line.name also includes the product description, which is not necessary. I would like to remove the description from the invoice lines but keep the internal reference and variant as part of the product name. Also line.product_id.name just includes the name but not the Variant oder reference.

Is there a way to achieve this globally in Odoo, so that the product description is no longer shown in each line of the invoice (both in the backend and on PDF invoices)? Only in Invocies would be also helpful at first.

Any help or guidance on how to implement this would be greatly appreciated.

Thank you in advance!

0
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

Hi,


Try the following code for removing the product description from the invoice line.


from odoo import _, api, fields, models

class AccountMoveLine(models.Model):

    _inherit = 'account.move.line'


    @api.depends('product_id', 'move_id.payment_reference')

    def _compute_name(self):

        def get_clean_name(line):

            values = []

            if line.partner_id.lang:

                product = line.product_id.with_context(lang=line.partner_id.lang)

            else:

                product = line.product_id

            if not product:

                return False

            # Add internal reference

            if product.default_code:

                values.append(f"[{product.default_code}]")

            # Add product name

            values.append(product.name or '')

            # Add variant attributes

            if product.product_template_attribute_value_ids:

                variant_names = ', '.join(

                    v.name for v in product.product_template_attribute_value_ids

                )

                values.append(variant_names)

            return ' '.join(values).strip()

        term_by_move = (self.move_id.line_ids | self).filtered(

            lambda l: l.display_type == 'payment_term'

        ).sorted(lambda l: l.date_maturity or date.max).grouped('move_id')

        for line in self.filtered(lambda l: l.move_id.inalterable_hash is False):

            if line.display_type == 'payment_term':

                term_lines = term_by_move.get(line.move_id, self.env['account.move.line'])

                n_terms = len(line.move_id.invoice_payment_term_id.line_ids)

                name = line.move_id.payment_reference or False

                if n_terms > 1:

                    index = term_lines._ids.index(line.id) if line in term_lines else len(term_lines)

                    name = _('%s installment #%s', name if name else '', index + 1).lstrip()

                if n_terms > 1 or not line.name or line._origin.name == line._origin.move_id.payment_reference:

                    line.name = name

            if not line.product_id or line.display_type in ('line_section', 'line_note'):

                continue

            if not line.name or line._origin.name == get_clean_name(line._origin):

                line.name = get_clean_name(line)


- For removing from the PDF, refer to the following.

* https://www.odoo.com/sl_SI/forum/pomoc-1/hide-product-name-on-invoice-just-have-description-270191

* https://www.odoo.com/sl_SI/forum/pomoc-1/remove-product-description-in-pdf-documents-239621



Hope it helps.

0
Imagine profil
Abandonează
Imagine profil
Jainesh Shah(Aktiv Software)
Cel mai bun răspuns

Hello, Nico


    To show only the product name, internal reference, and variant to be displayed—without the product description once

    user add a product in Invoice.

   

    Please create a custom module and add a below code of snippet

   

        1) Create a Module, after that create a account_move_line.py file and add it in folder called 'models'.


//Code in comment//


2) As you can see in below image that I have cretaed 3 new products, One Product without variants and Internal Reference,

   Second Product with Variants only and third product with Internal Reference.

   

   

3) For the report Please check below image.


 

Hope this helps !

     

If you need any help in customization feel free to contact us.


Thanks & Regards,

Email:    odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Imagine profil
Abandonează
Jainesh Shah(Aktiv Software)

# -*- coding: utf-8 -*-

from odoo import api, models, fields

class AccountMoveLine(models.Model):
"""Inherited account move line for customization"""
_inherit = 'account.move.line'

def _get_computed_name(self):
"""
Custom logic to compute the name for invoice lines.
This will include the product name, internal reference, and variant,
but will exclude the description.
"""
self.ensure_one()
name = self.product_id.display_name or ''
if self.product_id.default_code: # Internal Reference
name = name

# If it's a variant, append the variant details
if self.product_id.product_template_attribute_value_ids:
variant = ", ".join(
attr.name for attr in self.product_id.product_template_attribute_value_ids
)
name = name

return name

@api.depends('product_id', 'quantity', 'price_unit')
def _compute_name(self):
"""
Override to customize the behavior of the `name` field.
"""
for line in self:
if line.move_id.is_invoice(): # Only modify for invoices
line.name = line._get_computed_name()
else:
super(AccountMoveLine, line)._compute_name()

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Header Missing From PDF Invoice - V18 Community
invoice v18
Imagine profil
Imagine profil
2
oct. 24
2783
What are the value need to pass in field 'type' of account.invoice table in Odoo to get Customer_Invoice & Supplier_Invoice ?
invoice odoo
Imagine profil
Imagine profil
1
oct. 18
4710
Error Converting Sale Orders to Invoice
invoice odoo
Imagine profil
0
oct. 15
4145
Remove link from offer and invoice email Rezolvat
invoice emailtemplate odoo
Imagine profil
Imagine profil
Imagine profil
2
nov. 24
3778
Invoice form View 'Total' label to 'Gross' odoo 17 Rezolvat
invoice widget odoo
Imagine profil
Imagine profil
1
oct. 24
2212
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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