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

I'm trying to customize the res.partner view in Odoo 8, what I want Is to be able to change the placeholder or the string of some fields that are shown on the form through attributes, but no luck so far.

I have this code:

<xpath expr="//field[@name='mobile']" position="attributes">

<attribute name="attrs">{'placeholder':"Cellphone Numer", 'required':True}</attribute>

</xpath>


The required works just fine and the field appears in blue, but no placeholder text.

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

Carlos Rodriguez,

Here you go!

    <xpath expr="//field[@name='mobile']" position="attributes">

        <attribute name="placeholder">Cellphone Number</attribute>

        <attribute name="required">True</attribute>

    </xpath>

For updating each attribute information you have to define attribute tag.

Regards,

Anil.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Anil Kesariya, thank you very much I managed to find out how to do it

<xpath expr="//field[@name='fax']" position="attributes">

      <attribute name="attrs">{'required':True, 'invisible':False}</attribute>

      <attribute name="string">Fax Number</attribute>

      <attribute name="placeholder">Please introduce fax number</attribute>

</xpath>


Works like a charm.

Regards,

Carlos.

อวตาร
ละทิ้ง

Thats great.

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 22
2749
1
พ.ค. 22
3417
1
พ.ย. 24
1471
Change the Position of field in Xpath แก้ไขแล้ว
5
ก.ค. 24
92709
1
ธ.ค. 23
2935