Odoo Help


set default checked checkbox ? [Closed]

on 4/17/13, 10:48 AM 4,903 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 04/18/2013 05:21:35


I have two fields myfields1 and myfields2 (boolean), I want just like in res.partner, in customer view the customer checkbox is checked, and in supplier view the supplier checkbox is checked. I want in a view1 set myfields1 checkbox checked and in view2 set myfields2 checkbox checked.

How can'I do that??


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 4/17/13, 11:20 AM

You can do it by passing {'default_youfield':value} in context of action.

Here is an example in which I want only Supplier and not Customer:

<record model="ir.actions.act_window" id="action_partner_my">
    <field name="name">My Supplier Partner</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">tree,form</field>
    <field name="context">{"search_default_supplier":1,"default_supplier":1,"default_customer":0}</field>

When I will click on this action Supplier field will be True and Customer field will be False.


Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
| 2 1 4
Ahmedabad, India
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 4/17/13, 11:19 AM

You can check context passed for suppliers => <field name="context">{'search_default_supplier': 1,'default_customer': 0,'default_supplier': 1}</field>

You have to pass your values in action.


<record id="action_partner_supplier_form" model="ir.actions.act_window">
            <field name="name">Suppliers</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.partner</field>
            <field name="view_type">form</field>
            <field name="domain">[]</field>
            <field name="view_mode">kanban,tree,form</field>
            <field name="context">{'search_default_supplier': 1,'default_customer': 0,'default_supplier': 1}</field>
            <field name="filter" eval="True"/>

Regards, Mustufa

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

2 follower(s)


Asked: 4/17/13, 10:48 AM
Seen: 4903 times
Last updated: 3/16/15, 8:10 AM