Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Is it possible to save model to database in onchange function?

on 2/5/16, 4:25 AM 309 views

onchange functions work on virtual records assignment on these records is not written to the database.

Is it possible to save model to database in onchange function?

I am using odoo 8.


Let me describe my requirement in detail. I have a simple wizard form(the action target is 'inline') for searching. The form have 2 fields, one is a char field for the searching keyword and the other is a many2many field for the searching result. The onchange function for the keyword field will be triggered for fetching the searching result.

All above are working normally. The problem is when you leaving the page, the browser will popup an alert message something like 'Are you sure you want to leave this page...". This is not make sense for my searching page. For this reason, I think I need to save the wizard model in the onchange function, after this, the alert message wouldn't popup.

Simply, my requirement is to suspress the alert message when the form is not saved. How to make it? Please advice...

not recommended, why?

Axel Mendoza
on 2/5/16, 2:10 PM

Hi Axel, I have updated my question and describe my requirement in detail. If you have any advice plz update.Thanks!

on 2/5/16, 9:25 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 2/5/16, 4:25 AM
Seen: 309 times
Last updated: 2/5/16, 9:17 PM