Skip to content
Snippets Groups Projects
Commit 99703583 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: invoiced amount

- Create 2 companies: A is parent of B.
- Demo is in Company A
- Create 2 invoices for a partner: one in A, one in B (100 each)
- Validate the invoices

Connected as Demo, the 'Invoiced' amount on the partner form view (stat
button) is 100, while clicking on it shows both invoices (total of 200).

There is no need to manually add the company in the `where` clause since
the `_apply_ir_rules` will take care of adding the appropriate
multi-company rules.

opw-772479
parent 2d8e6ff0
Branches
Tags
No related merge requests found
......@@ -306,7 +306,7 @@ class ResPartner(models.Model):
# generate where clause to include multicompany rules
where_query = account_invoice_report._where_calc([
('partner_id', 'in', all_partner_ids), ('state', 'not in', ['draft', 'cancel']), ('company_id', '=', self.env.user.company_id.id),
('partner_id', 'in', all_partner_ids), ('state', 'not in', ['draft', 'cancel']),
('type', 'in', ('out_invoice', 'out_refund'))
])
account_invoice_report._apply_ir_rules(where_query, 'read')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment