Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

change string, placeholder, text with view inheritance

By
Carlos Rodriguez
on 4/10/15, 5:18 PM 1,871 views

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.

3

Anil R. Kesariya

--Anil R. Kesariya--
4321
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
-
Technical & Functional Expert
Anil R. Kesariya
On 4/11/15, 6:56 AM

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.

0
Carlos Rodriguez
On 4/13/15, 10:04 AM

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.

Anil R. Kesariya
on 4/14/15, 10:32 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/10/15, 5:18 PM
Seen: 1871 times
Last updated: 4/13/15, 10:04 AM