Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to Hide Internal Reference (default_code) in Sale Order Lines (Odoo SaaS 18.2+e)

形象
odoo
1 备注
形象
丢弃
形象
odoo
-

After 'display_default_code':False, the IR code is shown as a description. How can I stop that from happening, as I need the description column for another purpose? 

3 答案
0
形象
odoo
最佳答案

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


1 备注
形象
丢弃
形象
odoo
-

This worked for me!
Small remark: editing the context anly applies on new orders. Existing orders are still printed with the internal reference

0
形象
odoo
最佳答案

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.

1 备注
形象
丢弃
形象
odoo
-

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

0
形象
odoo
最佳答案

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.

1 备注
形象
丢弃
形象
odoo
-

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