wrong voucher created from bank statement

Bug #1257337 reported by Renato Lima - http://www.akretion.com on 2013-12-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

In bank statement, if you try import one journal item in journal with general type, you will receive this message:

"The amount of the voucher must be the same amount as the one on the statement line."

This occurs because if you create one payment using one account journal with general type, the account.statement.from.invoice.lines wizard does not use the right sign, you can see in this code:

            type = 'general'
            ttype = amount < 0 and 'payment' or 'receipt'
            sign = 1
            if line.journal_id.type in ('sale', 'sale_refund'):
                type = 'customer'
                ttype = 'receipt'
            elif line.journal_id.type in ('purchase', 'purhcase_refund'):
                type = 'supplier'
                ttype = 'payment'
                sign = -1

To fix this, the code should be this:

            type = 'general'
            ttype = amount < 0 and 'payment' or 'receipt'
            sign = amount < 0 and -1 or 1
            if line.journal_id.type in ('sale', 'sale_refund'):
                type = 'customer'
                ttype = 'receipt'
            elif line.journal_id.type in ('purchase', 'purhcase_refund'):
                type = 'supplier'
                ttype = 'payment'
                sign = -1

Best regards,

Renato Lima - http://www.akretion.com

In addons/7.0 revision #9672

Hello,

not sure if that's the same bug or not, but it's worth mentioning it looks similar as:
https://bugs.launchpad.net/openobject-addons/+bug/1211202

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers