Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3312 Tampilan

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
Buang

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

Penulis

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.

Jawaban Terbai

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
Buang
Penulis

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 Terkait Replies Tampilan Aktivitas
3
Agu 24
6680
3
Feb 24
2273
1
Mei 22
3167
1
Apr 22
3004
1
Sep 16
10553