Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
76 Lượt xem

Hi, this might be a minor thing but has some usefulness for user experience... does anyone know how to set the Optional field property in Odoo Studio to be neither "Show by default" or "Hide by default," meaning, it's left blank (like the screenshot on the right)? As of now, you can't choose blank.

The reason why I'm asking is that I noticed that default list columns that cannot be hidden (by selecting that upper right column selector on view tables) have no Optional value set. See below example (for PO Form's Unit Price column in the items list) behavior if the Optional field is blank like above right.


Stupid as it may seem, but some users would get confused if they accidentally hid the field (and don't know how to make it appear. So better not to allow anyone choose to hide some fields in a list (like what Odoo has made on key columns, like Unit Price and Quantity in PO forms.

Help on a workaround is very much appreciated. I'm using Odoo Online (v18.4e).

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Francis:

Studio does not allow you to do this directly but you can do it if you are familiar with developer mode and XML.

Here's a work around for this using Studio since it is not natively supported by Studio:

  1. Activate Developer Mode (Settings > General Settings).
  2. Open the view in Studio and go to the field you want to edit like you normally do.
  3. Change the value of "Optional" so Studio generates the XML for the customization.
  4. Click on the "View" tab on the left and then on the "XML" button like so.
  5. This will open the XML of the customization. Look for the part where the "optional" property of the field is changed and remove the value within the tag like so to leave it empty.
  6. Save the changes.

Your field will now be permanently visible and will be removed from the list of fields on the right.

NOTE: Make sure you are making the edits in a view whose name starts with "Odoo Studio: ..." and not one of Odoo's built in views.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you Paresh! Thank you for the detailed steps!

And I appreciate the warnings to lessen risk in editing underlying base view XML. I'll have to take note first that a form or view needs to be edited for the first time in Odoo Studio for its XML view with name starting "Odoo Studio" to be created and customized further.

Câu trả lời hay nhất

In Odoo Studio, the "Optional" field property is designed to either show or hide fields by default, but not leave them blank.



  To achieve a similar effect, consider setting the field to "Show by default" and then use access rights to control visibility.

  Alternatively, customize the view XML to remove the "optional" attribute for specific fields.

  Test the changes in a development environment to ensure they meet your user experience needs.


If you'd like to explore this further for your use case, you're welcome to connect with us at Pragmatic Techsoft.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 8 24
2843
0
thg 8 23
1410
0
thg 1 22
2527
1
thg 3 25
4499
1
thg 9 21
6174