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.

1

Modifying base field in inherited form

By
Ash Muir
on 4/2/13, 11:45 AM 4,082 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?

6

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 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"/>
</field>

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>
</field>

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
1

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 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

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

0 follower(s)

Stats

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