Reflect Changes on UI when updating a one2many or many2many field from python
₹1500-12500 INR
Closed
Posted over 5 years ago
₹1500-12500 INR
Paid on delivery
their is a model x which have one2many field y
what i am doing
when user attach mulitple attachments i have override create mathod attachment and if the attachment happen on x model then i am fetching some values from attachments and updating one2manyfield of model x record id xid with my newly created records of one2many types y by doing so newly created record are attached to model x on record xid on databse lavel(i have checked this by database ) means values of one2 many fields changes on databse ....
but this change not happening on UI lavel , I don't want to reload the page .
what i wanna acheive
without reloading page the newly one2many records added to model x record id xid should reflect on UI
I am showing these one2many fields in a notebook page in kanban box
bascially what i want to acheive is on adding multiple attachment on a record of this model from ui ,
if you have read my explanation fully ,, then propose a solution in the script
Hi, following are the 2 approaches through which you can auto update your page which reloading it.
1. Javascript.
You can run a javascript thread ( loop ) which will constantly look for updated values of field in the database. Once the values are update it will automatically update the UI
2. Web Sockets.
I think you are using python for the backend ( flask or django ). Therefore, you can use web sockets to pass on the updated values to UI which will in turn update the UI. The UI will keep listening to the socket, once the values are updated a message will be sent to the UI with the update values.
I can give you more insights once I get to know the details of the project. Please feel free to discuss
Thanks.