Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

How to remove product description from invoice lines?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
invoiceodoov18
2 Replies
2956 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Portretas
Jainesh Shah(Aktiv Software)
Best Answer

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
Portretas
Atmesti
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!

Registracija
Related Posts Replies Rodiniai Veikla
Header Missing From PDF Invoice - V18 Community
invoice v18
Portretas
Portretas
2
spal. 24
2759
What are the value need to pass in field 'type' of account.invoice table in Odoo to get Customer_Invoice & Supplier_Invoice ?
invoice odoo
Portretas
Portretas
1
spal. 18
4689
Error Converting Sale Orders to Invoice
invoice odoo
Portretas
0
spal. 15
4120
Remove link from offer and invoice email Solved
invoice emailtemplate odoo
Portretas
Portretas
Portretas
2
lapkr. 24
3722
Invoice form View 'Total' label to 'Gross' odoo 17 Solved
invoice widget odoo
Portretas
Portretas
1
spal. 24
2194
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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