Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
144 Ansichten

I have created a custom form in my custom module. The form does not have any required fields, and I also added a Submit button.

The issue is: whenever I type or select anything in the form, due to Odoo’s auto-save functionality, a record is created in the database without clicking the Submit button.

I want to avoid this auto-save behavior so that a record is only created when I click on the Submit button.

How can I achieve this without using a wizard or setting edit="false" / create="false"? Based on my logic, I cannot use those approaches.

Avatar
Verwerfen
Beste Antwort

Hello navedhusain,

In Odoo, a <form> view is always tied to a record.

When you type in a new form, Odoo must create() a record so it has an id to track changes and run onchange. That’s why auto-save happens.

👉 Therefore, you cannot disable auto-save in a standard form view unless you:

  1. Use a TransientModel (temporary model).
  2. Override JS controllers (FormController / FormRenderer).
  3. Set edit="false" / create="false".

⚠️ There’s no XML option to turn off auto-save.

✅ Odoo-native solution:

  • Use a TransientModel for your form (it doesn’t have to be a popup wizard).
  • On Submit, explicitly create the real record in your main model.

👉 Short answer:

Without a TransientModel or JS override, it’s impossible to avoid auto-save in Odoo forms.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Aug. 25
1
0
Aug. 25
22
0
Aug. 25
48
0
Aug. 25
20
0
Aug. 25
2