Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
25457 Weergaven

Hi,

I'm trying to remove "state" field in the res_partner address, because in Portugal there is no state in the address. So I'm trying to replace the state field with the "distritos" field.

I created the field like this:

_columns = {
    'distritos': fields.selection([
        ('av', 'Aveiro'),
        ('bj', 'Beja'),
        ('bg', 'Braga'),            
        ('bgc', 'Bragança'),
        ('cb', 'Castelo Branco'),
        ('c', 'Coimbra'),
        ('ev', 'Évora'),
        ('fr', 'Faro'),
        ('g', 'Guarda'),
        ('lr', 'Leiria'),
        ('lx', 'Lisboa'),
        ('ptg', 'Portalegre'),
        ('pt', 'Porto'),
        ('st', 'Santarém'),
        ('sb', 'Setúbal'),
        ('vc', 'Viana do Castelo'),
        ('vr', 'Vila Real'),
        ('v', 'Viseu'),
         ],'Distrito'),
}

In the view I tried like this :

        <xpath expr="//field[@name='state_id']" position="replace">       
        <field name="state_id" invisible="True"/> 
        </xpath>
        <xpath expr="//field[@name='country_id']" position="before">       
        <field name="distritos" placeholder="Distritos"/>
        </xpath>

But "Distritos" is shown in black (image below) , and I wanted that the color was grey like in the other type of fields (like "País" in the image below).

image description

Someone knows if it is possible to use placeholders with a field selection ?

Thanks

Avatar
Annuleer
Beste antwoord

Anabela Damason,


You can do this

<field name="distritos" placeholder="Distritos" style="color:#898687"/>

But, All options of select box will be changed to this color.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
dec. 21
12218
2
jun. 20
11967
1
okt. 18
21059
0
mei 15
3605
4
jan. 24
23033