Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
572 Vistas

I created a module in studio, in that I created a field in form view and went to the website and created a form on a new page. Whichever user fills up the form, it gets directly saved in my studio module, but when he comes back to that page and wants to update something, he should see his first form. 


this is a form who i build in studio and saved perfectly wanted to fetch my form value only like example.

each user has its own form whenever he/she create first time only after that the form is always update.

in website i created a app using studio i have created one form  field name stored working perfectly this form is display at website  not fetched. 

Avatar
Descartar
Mejor respuesta

To achieve that kind of behavior — where a user submits a form once and later returns to update it — you’ll need to create a custom Odoo website module.

Here’s how it works:

  • Backend Logic: You need a custom controller in Python that checks whether the logged-in user already has a record in your model. If they do, it fetches and displays that record in the form. If not, it shows an empty form for first-time submission.
  • Form Submission: The same controller can handle both creation and update, depending on whether a record for that user already exists.
  • Frontend Form: The form itself can be rendered using a QWeb template. You can prefill fields with existing values if the user has already submitted it.
  • JavaScript? Not always required. If you're okay with a full-page reload on form submission and rendering, you can handle everything using just Python and QWeb. But if you want a smoother experience — like updating the form without page reload (AJAX), live validations, or auto-saving — then yes, you’ll need to write custom JavaScript for that.

So, you don’t need JavaScript just to show or update a form, but you do need it for dynamic or real-time interactions.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
jul 25
844
0
jul 25
206
1
jul 25
483
1
may 25
1578
1
may 25
2145