Odoo Help


Modifying base field in inherited form

Ash Muir
on 4/2/13, 11:45 AM 6,150 views

How would you change the attributes of an existing field?

I have set up a form view that inherits base.view_partner_form

I want to hide the 'is_company' field. I still need it to have a value, so can't just use position=replace to remove it. I tried adding in <field name="is_company" invisible="1"/> but unsurprisingly it didn't work. how are you meant to do this?


Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/2/13, 11:51 AM

The correct code is:

<field name="is_company" position="replace">
    <field name="is_company" invisible="1"/>

I want to remind you that field attributes can also be changed like this:

<field name="is_company"  position="attributes">
    <attribute name="invisible">True</attribute>

Thanks, I tried it the first way and the field label is still showing up (with parentheses before and after the field) can this be hidden too?

Ash Muir
on 4/2/13, 12:01 PM

the label should be able to hide as any field: <label string="Blablabla" position="replace" />

Francesco OpenCode
on 4/2/13, 12:06 PM

Thanks again. You can probably tell I haven't quite got my head around it yet. On the form view "is_company" is in itself part of a label for the "name" field. I guess this is why parentheses are showing up. I think I can figure it out from here.

Ash Muir
on 4/2/13, 12:20 PM

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 4/2/13, 11:47 AM

do both, have the position replace and replace it with invisible=1

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/2/13, 11:45 AM
Seen: 6150 times
Last updated: 3/16/15, 8:10 AM