Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
384 Visualizzazioni

I'm currently using Odoo Online (SaaS) version 18.2+e (Enterprise Edition) and I'm trying to hide the internal reference (Product Code / default_code) from the Product field in Sale Order Lines.



I've successfully achieved this in Invoice Lines , Delivery Order Lines by using the context key:

​'display_default_code': False

Is there a reliable way to remove or hide the internal reference from the product display in Sale Order Lines, like it works in other document lines?


Thanks in advance!

Avatar
Abbandona
Autore Risposta migliore

Steps to Hide Internal Reference from Sale Order Lines:

  1. Activate Developer (Debug) Mode
  2. Open Sales Order
  3. Go to Debug Menu > User Interface > Action
  4. Under the General Settings tab, locate the field Context Value.
  5. Add This Context:     'display_default_code': False


Avatar
Abbandona
Risposta migliore

In Odoo SaaS 18.2+e, the internal reference (default_code) is shown in Sale Order lines by default.

To hide it, go to Studio, open the Sale Order Line form view, click on the product field, and in the right panel, uncheck the "Show Product Code" option or hide the related field showing the default code.

This will stop the internal reference from appearing on the sales order line. Changes apply only to your custom view.

Avatar
Abbandona

There is no checkbox and you can't hide the field with the product in it!!

Risposta migliore

Hi,


In Odoo SaaS (18.2+e), the internal reference (default_code) is shown in many product dropdowns by default, including Sale Order Lines.


Odoo uses a context variable 'display_default_code' to control whether the internal reference appears next to product names.


This works well in Invoice Lines and Delivery Order Lines, and can be applied similarly in Sale Order Lines.


Unfortunately, since you're on Odoo Online (SaaS), you cannot directly modify the XML views to inject the context on the product_id field in sale.order.line.


A potential workaround is to create a custom Studio field or duplicate the product_id field using Studio with the context { 'display_default_code': False }, if Odoo Studio allows context injection (limited support).


If Studio isn't enough, the most reliable solution is to request Odoo support via a ticket, asking them to hide default_code using the same context method used in invoices/deliveries.


Hope it helps.

Avatar
Abbandona

Can't see how the Studio approach could work, since Odoo needs that field when you add a product.