Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
20031 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ

Thats great.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 22
2783
1
thg 5 22
3454
1
thg 11 24
1593
5
thg 7 24
92848
1
thg 12 23
3018