How can I set the value of a field using javascript (on the client)?
In my view's XML-file, I have:
<field name="zip" />
<field name="city" class="city" />
When the zip changes, I want to do a lookup and set the city (I could do this on the server side with an @api.onchange method, but for performance reasons, I prefer client side).
The lookup works, and I can set the value with:
$('span.city input').val(city);
This puts the city in the input field, but the client doesn't get aware of the change (for instance, I have a server side onchange method to handle other fields, and this method does not get the new city value).
From what I can find, I should call set_value(city) on the field, but how do I find the right object to call the method on?