Skip to Content
Menu
This question has been flagged

I have a button that sets the value of a field it's python method. At the web client, I'd like to run some js when the field loads with the changed data, but I am unsure of where to modify. Since the value is changed server side, it is kind of opposite of onchange, which would do something when the user modifies the field at the client. I'm sure there is a standard solution to this, but I'm hoping someone can steer me in the right direction.

Avatar
Discard
Author

There is apparently no standard solution to this in fact. Tracing the client side code back suggests that on button click, the form saves it's data, then does the write in the button click action, then reloads, but does not ever set the _changes property client side or raise a fields_changed event. You can actually test this by creating a button to set a field value, then putting an onchange method on the field in python code. The field will update on button click, but the onchange won't fire. The best solution I've found so far is to use the OCA module web_notify to send an info notification in the action call.

Related Posts Replies Views Activity
0
Feb 19
2864
2
Jul 23
3678
0
May 21
2933
2
May 23
6672
2
Aug 21
5529