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

I added this code for adding digits in price unit 


<xpath expr="//field[@name='invoice_line_ids']//field[@name='price_unit']" position="replace">
<field name="price_unit" digits="[12,12]" column_invisible="parent.cover_sheet_count == 0"/>
<field name="price_unit" digits="[12,2]" column_invisible="parent.cover_sheet_count != 0"/>
</xpath>


it is working perfectly in using replace , when coversheet count != 0 the price unit with 12 decimal precision . 

when coversheet count == 0 price unit with 2 decimal precision 


When i use attribute like this 


<xpath expr="//field[@name='invoice_line_ids']//field[@name='price_unit']" position="attributes">
<attribute name="digits">[12,12]</attribute>
<attribute name="column_invisible">parent.cover_sheet_count == 0</attribute>
</xpath>

<xpath expr="//field[@name='invoice_line_ids']//field[@name='price_unit']" position="attributes">
<attribute name="digits">[12,2]</attribute>
<attribute name="column_invisible">parent.cover_sheet_count != 0</attribute>
</xpath>

when coversheet count == 0 price unit with 2 decimal precision  , only one scenario is working , 
coversheet count !=0 case the price unit field is invisible not decimal precision with 12 digits 


What is the reason for this behaviour ??


Avatar
Hylkää
Paras vastaus

Your first example is removing the price_unit field and replacing it with two price_unit fields.

Your second example is finding the price_unit field and changing the attributes, then finding the price_unit field again (the same field) and changing the attributes again - so only the second change is actually being made.

Avatar
Hylkää
Tekijä

Thanks. I understand

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
heinäk. 25
2049
1
kesäk. 25
2418
2
toukok. 25
2014
1
toukok. 25
1224
1
helmik. 25
38