I am currently working on a project where I have a dynamically generated document using Odoo. The document consists of multiple divs, each containing different types of input boxes such as checkboxes, text fields, and numbers.
Currently, every time a user makes changes to a field, an rpc call is made to the backend to store the new value in the database. However, this process is causing performance issues due to slow client-server communication and delays in writing to the database, especially for a checklist like this one.
Proposed Solution: My idea is to allow the user to make changes to multiple fields before saving them all with a single click of the "Update" button.
Current Challenge:
I lack expertise in JavaScript and need guidance on how to implement this feature. One approach I am considering is wrapping all generated rows within a form
tag and triggering form submission with form_id.submit()
upon clicking the "Update" button. I also aim to find a way to extract and store values from different input fields while doing so.
Are there any more efficient methods to achieve this desired functionality? For instance, instead of immediately storing new data when a field is modified, could I gather information into a structured format (e.g., dictionary, list, or array) and only save it once the user initiates the update process?
EDIT - Proposed Data Structure:
dict = {
id_line: {key: values, key: values},
id_line: {key: values, key: values},
...
}