Odoo Help


View invisible fields shown with defaults?

Matias Garcia Isaia
on 7/26/13, 6:29 PM 3,277 views

I've modified a view so some fields aren't shown when a given field is disabled (particularly, is_company from res.partner).

I've made a custom view that only shows Customers, and in my domain they're only Companies (there can never be a Person as a Customer). I've set 'default_is_company' : 0 in the action's context, but when I try to create a new Client (pressing the Create button), the fields that should be hidden are shown.

    <record id="view_partner_address_form1_inherit" model="ir.ui.view">
        <field name="name">res.partner.address.form1.inherit</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form" />
        <field name="arch" type="xml">
                <div class="oe_edit_only" position="replace">
                    <div class="oe_edit_only">
                        <label for="name"/>
                        <field name="is_company" invisible="True" on_change="onchange_type(is_company)" class="oe_inline"/>
                <field name="function" position="after">
                    <field name="birthplace" attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"/>
                    <field name="birthday" attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"/>

    <record id="action_partner_form_inherit_customer" model="ir.actions.act_window">
        <field name="name">Customers</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">res.partner</field>
        <field name="view_type">form</field>
        <field name="view_mode">kanban,form,tree</field>
        <field name="context">{ 'search_default_customer':1, 'default_customer':1, 'default_is_company':1 }</field>
        <field name="search_view_id" ref="base.view_res_partner_filter"/>

__IMAGE LINK:__ http :// i43.tinypic.com/28cn8s0.png

If I edit an existing entity (even a new one created with this buggy form), the fields are correctly hidden.

Any idea what's wrong with this?

I'm using OpenERP 7.0-20130623-231037, in Spanish as you can see.

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: 7/26/13, 6:29 PM
Seen: 3277 times
Last updated: 3/16/15, 8:10 AM