تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
20163 أدوات العرض

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 22
2902
1
مايو 22
3601
1
نوفمبر 24
1774
5
يوليو 24
93245
1
ديسمبر 23
3154