Odoo Help


How to change the view used by many2many 'Add' Button? [Closed]

on 8/21/13, 11:31 PM 4,325 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 12/07/2013 11:43:50

Is it possible to use a different Tree View when the user clicks the 'Add' Button on a many2many_kanban field.

The particular example I am looking at is in the account_payment module, from the view Accounting > Payment > Payment Order, you can select run a wizard using the 'Select Invoices to Pay' button and then 'Search. The following wizzard view will be displayed, with a many2many 'entries' field:

image description

Clicking 'Add' will bring up the following view, image description

What I need to be able to do is use my own custom tree view instead of the default tree view for account.move in the view displayed above. Does anyone have any ideas how to do this?

Hi guys, Im Trying something similar, could you take a look? http://help.openerp.com/question/33692/editablebottom-not-working/

MEXYTUL, Diego Calzadilla
on 10/11/13, 3:32 AM

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 8/26/13, 5:45 AM

Hello Dawn,

You need to do following for use your custom tree view instead of the default tree view.

In .xml file do as follwoing:

 <record id="view_payment_order_create_tree_inherit" model="ir.ui.view">
    <field name="name">payment.order.create.tree.inherit</field>
    <field name="model">payment.order.create</field>
    <field name="inherit_id" ref="account_payment.view_create_payment_order_lines"/>
    <field name="arch" type="xml">
        <xpath expr="/form/group/field[@name='entries']" position="attributes">
             <attribute name="context">{'tree_view_ref':'You_Custom_tree_View'}</attribute>

Hope this will help you.

Thank you.

Perfect, thanks so much!

on 8/28/13, 2:38 AM

Omal Bastin

--Omal Bastin--

| 6 6 8
Kochi, Kerala, India
--Omal Bastin--

Swiming deep into openERP/ODOO

Omal Bastin
On 8/23/13, 7:14 AM

in the view , in your field, add context having tree_view_ref. For example

<field name="journal_ids" context="{'tree_view_ref':'module_name.my_joural_tree_view'}" />

Don't forget that the value is a string so: <field name="journal_ids" context="{'tree_view_ref': 'module_name.my_joural_tree_view'}" /> Thanks!

Paul Catinean
on 12/5/13, 9:58 AM

updated..thanks Paul

Omal Bastin
on 12/6/13, 5:54 AM

I cannot vote yet but it saved my day! (and night!) PS: it works also for 'search_view_ref' key ;)

Alessandro Domanico
on 11/5/15, 1:50 PM

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: 8/21/13, 11:31 PM
Seen: 4325 times
Last updated: 3/16/15, 8:10 AM