[FIX] account_voucher: import invoices, sign according to transaction type
This commit is contained in:
parent
1f5c6f16d9
commit
faa04a43de
|
@ -78,10 +78,11 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
||||||
'invoice_id': line.invoice.id})
|
'invoice_id': line.invoice.id})
|
||||||
type = 'general'
|
type = 'general'
|
||||||
ttype = amount < 0 and 'payment' or 'receipt'
|
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'):
|
if line.journal_id.type in ('sale', 'sale_refund'):
|
||||||
type = 'customer'
|
type = 'customer'
|
||||||
ttype = 'receipt'
|
ttype = 'receipt'
|
||||||
|
sign = 1
|
||||||
elif line.journal_id.type in ('purchase', 'purchase_refund'):
|
elif line.journal_id.type in ('purchase', 'purchase_refund'):
|
||||||
type = 'supplier'
|
type = 'supplier'
|
||||||
ttype = 'payment'
|
ttype = 'payment'
|
||||||
|
|
Loading…
Reference in New Issue