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.


Change the default value using javascript

on 9/12/13, 9:17 AM 1,125 views

Hello All, I want when the user set a value to the filed the system save it and when he create a new record the system suggest this value. any suggestion ? Thank you

Why do you want to do it with javascript? You can do it on openerp with defaults and a function that throws the last value inserted and that's all.

GH Mediacloud, Grover Menacho
on 9/12/13, 11:55 PM

Please let me the function name. what i can put here _defaults = { 'my_field' : ???, }

ABC-EMEA, mostafa
on 9/15/13, 6:46 AM
Martin Pishpecki
On 9/24/14, 2:30 AM

I have the same problem. In the ineger fields the default value is 0. If you try to set this to some other value, using the _defaults like so: _defaults = { 'account_id': None,  }. You can set it to any value except for Null value. I guess this gets overriden with the javascript controll seting a value 0 if there is no value given by the server. Any ideas on this. Thank you.

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: 9/12/13, 9:17 AM
Seen: 1125 times
Last updated: 3/16/15, 8:10 AM