Skip to Content
Menu
This question has been flagged
4 Replies
3774 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





Avatar
Discard

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

Author

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

Author

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

Author Best Answer

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>

Avatar
Discard