Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3674 Visualizzazioni

Hi guys

in V18 i will get the following error on test

Please indicate why the always invisible fields are present in the view, or remove the field tag.

as i understood in some cases like to use the filed on  modifier 'invisible' we dont need to have them anymore the views so we can remove them from view but in some case still we need to have some field always invisible in the view. do you have any idea how we can avoid such this error?


Best Regards

Avatar
Abbandona

Did you miss something in the post ? seems no info about the error you face

Autore

No i did not missed the Error is 

Please indicate why the always invisible fields are present in the view, or remove the field tag.

and after that xml id the error will happen in Odoo test suite.

Risposta migliore

Odoo enforces a warning system for "always invisible fields" to maintain code quality and optimization. While invisible fields are allowed for legitimate purposes (computations, conditional logic, technical requirements), developers must justify their presence through documentation. This serves as a code quality check to keep views clean and performant, encouraging intentional use of invisible fields with proper commenting.

You can avoid the warning by: 
Adding an XML comment before the invisible field:


<field name="helper_field" invisible="1"/> <!-- Required for computing total amount --> 

Avatar
Abbandona
Autore

i Have already test it and it did not worked at all but if you do the comment in front of filed it will work like
<field name="helper_field" invisible="1"/> <!-- Required for computing total amount -->

Hi, this actually works, no need to add comment above the line:
<field name="field_name" invisible="1"/> <!-- Comment justifying the invisibility -->
This will work.

Post correlati Risposte Visualizzazioni Attività
3
ago 24
6855
3
feb 24
2380
1
mag 22
3262
1
apr 22
3102
1
set 16
10690