Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4280 มุมมอง

Hello all,

I'm dealing with strange behaviour with replacing field in Asset Form what i want to do is make field invisible in case of method has specific value. 

Any one have Idea what is wrong? 

Not working

<xpath expr="//field[@name='prorata_computation_type']" position="replace">
    <field name="prorata_computation_type" invisible="method in ['l10n_cz_asset_systee_same_as_tax']" readonly="state not in ['draft', 'model']"/>
</xpath>

Working

<xpath expr="//field[@name='prorata_date']" position="replace">
    <field name="prorata_date" invisible="method in ['l10n_cz_asset_systee_same_as_tax']" readonly="state not in ['draft', 'model']"/>
</xpath>


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Interesting, I have the same problem and not figured out what's the problem.
I tried it with the field date in account.move to change attributes as well as replace the field or use before or after.
Nothing happend.


Update, I think I figured it out. I used studio the same way and it worked. 


My code (not working):

expr="//field[@name='date']"


Studio code (working):

expr="//form[1]/sheet[1]/group[1]/group[2]/field[@name='date']"

The pure difference is, that studio uses the complete path. I think the field is used in the view somewhere before.

อวตาร
ละทิ้ง
ผู้เขียน

Thank you this happen in moment when View has this field multiple times or xpath find more then one selection

ผู้เขียน คำตอบที่ดีที่สุด

This is happen in the moment that XML view has multiple fields with same name (xpath) in the View and this selection doesn't work in that moment.   

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 24
39
1
เม.ย. 24
1725
1
มิ.ย. 19
8983
Change existing xpath expression in Odoo แก้ไขแล้ว
1
พ.ย. 18
8868
1
ก.ค. 18
8036