Odoo Help

Welcome!

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.

0

Database default value

By
willie ho
on 2/17/15, 2:48 AM 486 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
4

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
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'

}

example:

_default = {

 'name' : 'Andrew',

  'age' : 20

}

 

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

default_get() method

 

1

aneesh ATEES Infomedia Pvt Ltd

--aneesh ATEES Infomedia Pvt Ltd--
765
| 5 1 6
Thrissur, India
--aneesh ATEES Infomedia Pvt Ltd--

9995074692

aneesh ATEES Infomedia Pvt Ltd
On 2/17/15, 3:27 AM

write this code in .py file

_columns = {

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

}

_defaults = {

 'gender' : 'm'

}

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)

Stats

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