Search code examples
odooodoo-10odoo-9

Get partner (including its children) invoices


I'm trying to get the first and last invoices for a partner including its children.

Is there any method to get all partner invoices including its children? Otherwise, how can I get it using SQL query?


Solution

  • You can use the child_of domain operator. So if partner_id is the partner you want all invoices of including all invoices of its children, your search domain should look like:

    [('partner_id', 'child_of', partner_id)]