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

Filtering a tree list

By
Jihen BEN ALI
on 7/2/15, 8:19 AM 547 views

I am trying to develop a module in odoo 8 wich displays a filter, by wich I can filter the payment methods according to the journal_id (bank / check / ... )

here is my xml code for the filter method:

<record id="view_voucher_inherit_filter" model="ir.ui.view">

<field name="name">checks.search</field>

<field name="model">account.voucher</field>

<field name="inherit_id" ref="account_voucher.view_voucher_filter"/>

<field name="arch" type="xml">

<filter string="Posted" position="after">

<filter icon="terp" string="Cheques" domain="[('journal_id', '=', 'bank')]" help="Checks"/>

</filter>

</field>

</record>

the filter did not display the fields (payment) by the appropriate journal method because in the database journal_id is an integer field.

any help plz





hi, you can test this : domain="[('journal_id.type', '=', 'bank')]"

Guillaume Seran
on 7/2/15, 9:12 AM

Thank you for your answer but it doesn't work any suggestion please???????????

Jihen BEN ALI
on 7/3/15, 2:57 AM

I have figure out the solution How can I set this filter as a default filter????

Jihen BEN ALI
on 7/3/15, 3:56 AM
0
Jihen BEN ALI
On 7/3/15, 3:58 AM

The solution is as follow:

<record id="view_voucher_inherit_filter" model="ir.ui.view">

<field name="name">checks.search</field>

<field name="model">account.voucher</field>

<field name="inherit_id" ref="account_voucher.view_voucher_filter"/>

<field name="arch" type="xml">

  <filter string="Posted" position="after">

       <filter icon="terp" string="Cheques" domain="[('journal_id.code', '=', 'TCHK')]" help="Checks"/>

  </filter>

</field>

</record>

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: 7/2/15, 8:19 AM
Seen: 547 times
Last updated: 7/3/15, 3:58 AM