openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #26875
[Bug 1257337] [NEW] wrong voucher created from bank statement
Public bug reported:
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
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1257337
Title:
wrong voucher created from bank statement
Status in OpenERP Addons (modules):
New
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
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1257337/+subscriptions
Follow ups
References