İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3357 Görünümler

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
Vazgeç

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

Üretici

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.

En İyi Yanıt

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
Vazgeç
Üretici

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.

İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Ağu 24
6703
3
Şub 24
2319
1
May 22
3199
1
Nis 22
3014
1
Eyl 16
10588