Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2657 Prikazi

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
4
maj 24
12343
1
apr. 24
3029
0
nov. 23
1854
1
sep. 23
1933
2
avg. 23
4248