I have added a compute field and I am calling API while rendering from Tree view to Form view and updating value in another fields as well. Currently want happening, form view get loading but compute function taking 2 seconds to fetch data, after fetching data I am able to update data of other fields (Visible in database table), but Form data is not getting updated. How can we :
1. Load form view after compute done and adding value in other fields
2. Auto-update the form view once my compute fields function executed.
Model :
class testCompute(models.Model):
_name = 'test_compute'
test_data= fields.Html('Recording', size=256)
test_compute= fields.Char('Token', compute='getData', size=256)
def getData(self, user_uuid=None):
#API call to get data and getting HTML response - Taking almost 2 seconds to call API
# Updating test_data data field once get response from API call(HTML data in response)
Working Alternative Soln :
I have added a button on Form view and called this function using action="getData" . It is working fine and updating all fields, but when I am redirecting from Tree view to Form view it is not working
<button name="getData" string="Get Data" type="object"/>