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

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

By
vim24
on 8/21/13, 11:31 PM 3,164 views

The Question has been closed

by
Sudhir Arya (SA)
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
2

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 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>
        </xpath>
    </field>
</record>

Hope this will help you.

Thank you.

Perfect, thanks so much!

vim24
on 8/28/13, 2:38 AM
5

Omal Bastin

--Omal Bastin--
1146
| 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 8/21/13, 11:31 PM
Seen: 3164 times
Last updated: 3/16/15, 8:10 AM