I have a strange situation with the party.address form in which it loads different subdivisions lists depending on where the form was loaded. In the normal circumstances, when I open a party from the party list, the party form loads correctly. All the values in the party.address model are loaded including the party.address.subdivision_types field. This field is of type function, and is needed to filter the choices of subdivisions for a given country so only certain category for example provinces or states are displayed.
However when this same form is loaded as a result of a wizard action, the party.address.subdivision_types value appears not loaded. I looked at the XHR messages between SAO and the server and found that the returned JSON object from the wizard’s execute call has this field’s missing in the defaults values dictionary. Hence, SAO, on its next request to read the subdivisions list, passes a domain without subdivision_types filter and the server returns all possible subdivisions for the particular country, which is not correct.
I don’t know yet where the source of the problem is, but I suspect it may be related to the fact that functions fields are lazy loading by default and it may contribute to the server not returning it unless the clients requests it.
Has anyone seen this problem before?