Ir al contenido
Menú
Se marcó esta pregunta

I want to display the label in a black color but odoo overrides the class of the label because the field is a computed field.


What i tried




also tried this




which gives an error;

Label tag must contain a "for". To match label style without corresponding field or button, use 'class="o_form_label"'.

which does not make sense...


My current workaround





I don't want an extra field to be able to make the label black.

Avatar
Descartar
Autor

why is the code showing properly when writing the post, but when posted it just shows white...

what i tried
<xpath expr="//div[@name='pricing']" position="after">
<label for="price_including_vat" class="o_form_label" string="Prijs BTW Incl."/>
<field name="price_including_vat" widget="monetary" nolabel="1" readonly="1"/>
</xpath>

also tried
<xpath expr="//div[@name='pricing']" position="after">
<label class="o_form_label" string="Prijs BTW Incl."/>
<field name="price_including_vat" widget="monetary" nolabel="1" readonly="1"/>
</xpath>

workaround
<xpath expr="//div[@name='pricing']" position="after">
<label for="dr_placeholder" class="o_form_label" string="Prijs BTW Incl."/>
<field name="dr_placeholder" nolabel="1" invisible="1"/>
<field name="dr_price_including_vat" widget="monetary" string="Prijs BTW Incl." nolabel="1" readonly="1"/>
</xpath>

Publicaciones relacionadas Respuestas Vistas Actividad
0
abr 24
1357
0
mar 24
1656
2
mar 24
3331
1
may 23
2447
1
jul 24
1191