Odoo Help


How to filter rows in internal tree?

on 5/29/13, 12:31 PM 2,644 views


I am trying to add a tree to res.partner form displaying all the non-paid invoices.

I managed to display the tree but I don't know how to filter rows : I want to show only the invoices that are not paid (state = open).

I tried to add a "domain" on the tree but it didn't work.

Here is my code :

<record id="view_partner_inherit_followup_form" model="ir.ui.view">
    <field name="name">res.partner.followup.form.inherit</field>
    <field name="inherit_id" ref="base.view_partner_form"/>
    <field name="model">res.partner</field>
    <field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
    <field name="arch" type="xml" >
        <page string="Accounting" position="before" version="7.0">
            <page string="Relances paiement" groups="account.group_account_invoice" name="followup_tab">
                <field name="invoices" string="Factures">
                  <tree colors="red:state == 'open'; green:state == 'paid';" domain="[('state', '==', 'open')]">
                    <field name="number" />
                    <field name="date_invoice"/>
                    <field name="colonne_due1" sum="Total 1-30" />
                    <field name="colonne_due2" sum="Total 31-45"/>
                    <field name="colonne_due3" sum="Total 46-50"/>
                    <field name="colonne_due4" sum="Total 51-60"/>
                    <field name="colonne_due5" sum="Total 61+"/>
                    <field name="amount_total" sum="Total"/>
                    <field name="state" invisible="True" />

Can anyone give me a way to show only open invoices?

On 5/30/13, 10:27 AM

I just solved my problem by adding the domain in the python code :

'factures': fields.one2many('account.invoice', 'partner_id', 'Invoices', domain=[('state','=','open')], readonly=True),

It works this way but if anyone knows why it did not work in the xml, please tell me.



Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 5/29/13, 3:46 PM

You need the domain on the field invoices.

Try something like:

<field name="invoices" string="Factures" domain="[('state', '=', 'open')]">

I already tried it but it doesn't seems to work... Thanks anyway

on 5/30/13, 10:10 AM

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: 5/29/13, 12:31 PM
Seen: 2644 times
Last updated: 3/16/15, 8:10 AM