From 1a2d054b8499a78f6f4f8a2024c3b561502a93e5 Mon Sep 17 00:00:00 2001 From: Jose Patricio Villarreal <> Date: Wed, 11 Jul 2012 16:59:15 +0530 Subject: [PATCH] [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 --- addons/account_voucher/account_voucher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 2cefaf15f0e..dc46ec57722 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -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