Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
8431 Näkymät

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? :)

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Tekijä

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

Tekijä Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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.

Avatar
Hylkää
Tekijä

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.

Tekijä

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

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
jouluk. 23
22251
5
heinäk. 24
15614
1
kesäk. 22
27133
9
toukok. 22
53378
0
heinäk. 20
2940