From faa04a43de9e515eb7e02bd0064848f7c35d7f0a Mon Sep 17 00:00:00 2001
From: Denis Ledoux <dle@odoo.com>
Date: Mon, 22 Sep 2014 15:58:24 +0200
Subject: [PATCH] [FIX] account_voucher: import invoices, sign according to
 transaction type

---
 .../account_voucher/wizard/account_statement_from_invoice.py   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py
index 4644bdee62d9..41d3560e2784 100644
--- a/addons/account_voucher/wizard/account_statement_from_invoice.py
+++ b/addons/account_voucher/wizard/account_statement_from_invoice.py
@@ -78,10 +78,11 @@ class account_statement_from_invoice_lines(osv.osv_memory):
                             'invoice_id': line.invoice.id})
             type = 'general'
             ttype = amount < 0 and 'payment' or 'receipt'
-            sign = 1
+            sign = 1 if ttype == 'receipt' else -1
             if line.journal_id.type in ('sale', 'sale_refund'):
                 type = 'customer'
                 ttype = 'receipt'
+                sign = 1
             elif line.journal_id.type in ('purchase', 'purchase_refund'):
                 type = 'supplier'
                 ttype = 'payment'
-- 
GitLab