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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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
write this code in .py file
_columns = {
'gender' : fields.selection([('m','Male'),('f','Female')],'Gender')
}
_defaults = {
'gender' : 'm'
}
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
detail your question.