Se rendre au contenu

Advanced Description on Sales Order

Provide Advance Description using Python code on Sale Order Line
42,96 € 42,96 € (Hors taxes)
US$ 50,00 (Hors taxes)

  • Versions
Conditions générales
Garantie satisfait ou remboursé de 30 jours
Livraison : 2-3 jours ouvrables


ODOO'S FUNCTION

By default, Odoo uses a hardcoded description on Sales Order Lines, which consists of the Product Reference/Product Name and does not allow flexibility in defining priorities. For example, if you define a supplier reference in the Supplier Pricelist, the description on Purchase Order Lines will display only the Supplier Reference and no longer include your Product Reference.

CLUEDOO'S FUNCTION

CLuedoo introduces the ability to configure product descriptions using Python code within the Product Categories. This allows you to customize descriptions by category and gain full control over how product information appears on Sales Orders and Purchase Orders.


In the Product Category form, you can enter Python code to define the product description displayed on Sales Order Lines. 

The values can be derived from the following objects: Sale Order Line (sale.order.line), Product Template (product.template), Product Variant (product.product), and (order_line) that can work for both sale and purchase.



EXAMPLE 1
result = product_template_id.x_studio_country + ' ' + product_template_id.default_code

This code is to display the Internal Reference and Country (a custom field created with Odoo Studio) in the product description on sales order lines.

After that, when you create a Sales Order and select a product under the Office Furniture category, the Country and Internal Reference will appear in the description on the order line.
If you add an MTO product to the SO, then the advanced description will be automatically inherited to the corresponding PO
EXAMPLE 2
if order_line._name == "sale.order.line":    desc = product_template_id.default_codeelif order_line._name == "purchase.order.line":    desc = product_template_id.categ_id.name
result = desc
  • In SOL: shows the product's Internal Reference
  • In POL: shows the product's Category Name

In Sales Order Lines

In Purchase Order Lines