Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
92 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
серп. 25
202
0
серп. 25
124
1
серп. 25
304
3
серп. 25
302
1
серп. 25
465