Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    Real Estate
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    Consulting
    • Accounting Firm
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • Solar Energy Systems
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    Others
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

How to remove product description from invoice lines?

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
invoiceodoov18
2 ตอบกลับ
2958 มุมมอง
อวตาร
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
อวตาร
ละทิ้ง
อวตาร
Cybrosys Techno Solutions Pvt.Ltd
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
อวตาร
Jainesh Shah(Aktiv Software)
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
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()

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
Header Missing From PDF Invoice - V18 Community
invoice v18
อวตาร
อวตาร
2
ต.ค. 24
2760
What are the value need to pass in field 'type' of account.invoice table in Odoo to get Customer_Invoice & Supplier_Invoice ?
invoice odoo
อวตาร
อวตาร
1
ต.ค. 18
4690
Error Converting Sale Orders to Invoice
invoice odoo
อวตาร
0
ต.ค. 15
4123
Remove link from offer and invoice email แก้ไขแล้ว
invoice emailtemplate odoo
อวตาร
อวตาร
อวตาร
2
พ.ย. 24
3731
Invoice form View 'Total' label to 'Gross' odoo 17 แก้ไขแล้ว
invoice widget odoo
อวตาร
อวตาร
1
ต.ค. 24
2195
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

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