Odoo Help


Database default value

willie ho
on 2/17/15, 2:48 AM 850 views

I want to add default value on database since I may want to edit records without using odoo

what should I put to give a default value on batabase?

detail your question.

Demirel yakito
on 2/17/15, 2:58 AM
On 2/17/15, 3:03 AM

yes can use use the default values for the fields,

if you want some small number of fields as default value means ,you can use

_default = {

 'your_field' : 'your_default_value'



_default = {

 'name' : 'Andrew',

  'age' : 20



otherwise,if you want to diplay more values as default means ,you can use

default_get() method



write this code in .py file

_columns = {

     'gender' : fields.selection([('m','Male'),('f','Female')],'Gender')


_defaults = {

 'gender' : 'm'


About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/17/15, 2:48 AM
Seen: 850 times
Last updated: 3/16/15, 8:10 AM