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.

1

Adding custom selection box

By
B G
on 9/1/13, 12:31 PM 2,353 views

Hi,

I'm trying to add a custom selection box, but I am running into an issue with max field length.

In my field setup, I have chosen Field Type:selection and entered...

[('straight_hem','Straight Hem'), ('adjustable_hem','Adjustable Hem'), ('ribbed_hem', 'Ribbed Hem')]

...in the SELECTION OPTIONS, which works.

However if it won't let me add any more options because I'm exceeding the 128 character max limit.

Am I doing this the right way? :)

1

Cameron

--Cameron--
769
| 6 5 8
United Kingdom
--Cameron--
Cameron
On 9/1/13, 4:13 PM

By chance I saw this yesturday - a trick using a function and tuple

Go here and scroll down to "selection"

Its from V6 but should be ok for V7

I don't know how to code.. I was hoping to do this though the GUI. Thanks

B G
on 9/1/13, 7:04 PM
0
B G
On 9/1/13, 7:04 PM

I don't know how to code.. I was hoping to do this though the GUI. Thanks

0

Daniel Reis

--Daniel Reis--
3436
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis
On 9/2/13, 6:29 AM

A short-term workaround would be to use smaller text strings, such as:

[('s','Straight Hem'),('a','Adjustable Hem'),('r','Ribbed Hem')]

That get's you from 100 characters to 64.

Another option to consider is to create a Model for this list and replace the selection field by a one2many relation field.

Thanks for this. I have a few fields that require a lot more options than this so it looks like I'll need to create a model. Would you be able to point me to the exact section in the manual I need to read about this? I am a beginner developer at best so need pointing in the right direction. Thank you.

B G
on 9/2/13, 7:20 AM

It's ok - I found this: http://help.openerp.com/question/378/creating-a-new-model-example/ - thank you.

B G
on 9/2/13, 7:24 AM

If this answer helped you, it's good practice to reward it marking it as "correct", or at least upvote it.

Daniel Reis
on 9/4/13, 5:43 AM

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