跳至內容
選單
此問題已被標幟
2021 瀏覽次數

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.

頭像
捨棄
作者

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>

相關帖文 回覆 瀏覽次數 活動
0
4月 24
1369
0
3月 24
1671
2
3月 24
3360
1
5月 23
2457
1
7月 24
1201