[FIX] added warning message in bank statement line,raise when invoice is already canceled

lp bug: https://launchpad.net/bugs/1022677 fixed

bzr revid: rmu@tinyerp.com-20120711112915-ffl9q3nn721hppjt
This commit is contained in:
Jose Patricio Villarreal 2012-07-11 16:59:15 +05:30 committed by Ravish Murari (OpenERP)
parent 6cbb04758a
commit 1a2d054b84
1 changed files with 2 additions and 0 deletions

View File

@ -1047,6 +1047,8 @@ class account_voucher(osv.osv):
# if the amount encoded in voucher is equal to the amount unreconciled, we need to compute the
# currency rate difference
if line.amount == line.amount_unreconciled:
if not line.move_line_id.amount_residual:
raise osv.except_osv(_('Wrong bank statement line'),_("You must have delete the bank statement line manualy to which the payment was reconcile. Please check the payment of the partner %s by the amount of %s !")%(line.voucher_id.partner_id.name, line.voucher_id.amount))
currency_rate_difference = line.move_line_id.amount_residual - amount
else:
currency_rate_difference = 0.0