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.

2

how to remove first empty element from fields.selection [Closed]

By
priyankahdp
on 3/29/13, 8:40 AM 4,319 views

The Question has been closed

by
priyankahdp
on 04/22/2013 04:58:16

need to remove first empty element from selection drop down list.and one is selected default.please advice me to do that friends..

selection field

its comes like

Gender
-----------------------------
|                         |v|
-----------------------------
EMPTY ELEMENT
-----------------------------
Male
-----------------------------
Female
-----------------------------
1

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 3/29/13, 8:51 AM

The "empty element" gives you the opportunity to leave the field empty. If you need to insert a default value in the field you can use:

_defaluts = {
  'field_name' : 'default_value',
}

or you can set the field as required so the user are forced to select a voice in the selection to save the recvord.

thanks Francesco . :-)

priyankahdp
on 3/29/13, 9:12 AM

Thanks Its working :)

Vaibhav
on 10/21/13, 12:04 PM

I used default value. Its working fine form loading with default value but in the drop down empty options also shown. How to remove empty options completely and in the selection shows only two options. (male, female) Thanks for your help

Prakash
on 1/17/14, 10:18 AM

As Prakash says, the default not removes empty option from selection field. I think this answer not resolve the question asked. I think the empty option should be removed after user selects as required field, but is not happens yet.

Rui Andrada
on 12/7/14, 9:47 PM

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 3/29/13, 8:40 AM
Seen: 4319 times
Last updated: 4/12/16, 1:18 AM