Ir al contenido
Menú
Se marcó esta pregunta
2663 Vistas

I have overridden view_init() in my module so I can do some processing when the form view is opened. However, this method gets called 6 times when I open the form view, which seems strange.

Here is my code:

@api.model
def view_init(self, fields_list):
    print("Initializing the form view")

If I print fields_list, it prints 6 lists. Each list contains the name of one field in my model. For example, it will print

['field_0']
['field_1']
['field_2']
['field_3']
['field_4']
['field_5']

Why doesn't view_init() just get called once with a list of all 6 fields? Why is it called 6 times for each field instead?

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
may 24
12363
1
abr 24
3054
0
nov 23
1865
1
sept 23
1964
2
ago 23
4275