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.

0

Help me write this domain and context.

By
Arjun Khode
on 3/27/15, 7:07 AM 583 views

I have this button

<button name="%(payment_action)d" context="{'ref':investment_id}" string="View Payments" col="1" type="action"/>

This button passes 'investment_id' as 'ref' field through the context written as above. The action looks like this:

<record id="payment_action" model="ir.actions.act_window">

<field name="name">Payments</field>

<field name="res_model">account.move</field>

<field name="view_type">tree</field>

<field name="view_mode">tree</field>

<field name="domain">[('ref','=','ref')]</field>

<field name="view_id" ref="account.view_move_tree"/>

<field name="target">new</field>

</record>

This action displays a list of all journal entries. In journal entries, there is a field called 'ref' which contains a reference ID. I want to display only those journal entries whose 'ref' is same as the 'investment_id' passed by the button into 'ref' field. My current domain in the action displays just a blank tree view. So what domain do I need to write to make this work right?

1

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 3/27/15, 7:13 AM

Try,

<field name="domain">[('ref','=',context.get('ref'))]</field>

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

1 follower(s)

Stats

Asked: 3/27/15, 7:07 AM
Seen: 583 times
Last updated: 3/27/15, 7:51 AM