[MERGE] forward port branch 10.0 up to b1ce2dd6c1

This commit is contained in:
Christophe Simonis
2017-10-10 13:00:48 +02:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -279,7 +279,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')
@@ -136,7 +136,7 @@ class AccountInvoiceReport(models.Model):
JOIN (
-- Temporary table to decide if the qty should be added or retrieved (Invoice vs Refund)
SELECT id,(CASE
WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
WHEN ai.type::text = ANY (ARRAY['in_refund'::character varying::text, 'in_invoice'::character varying::text])
THEN -1
ELSE 1
END) AS sign