Skip to Content
Menu
This question has been flagged
2461 Views

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
Discard
Related Posts Replies Views Activity
4
May 24
10079
1
Apr 24
1566
0
Nov 23
525
1
Sep 23
572
2
Aug 23
2429