Ashvin Rathod (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-805996-ara into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #805996 in OpenERP Addons: "res_partner bank - IBAN must check for 
SWIFT/BIC in res_bank"
  https://bugs.launchpad.net/openobject-addons/+bug/805996

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-805996-ara/+merge/68646

Hello,

Fix: res_partner bank - IBAN must check for SWIFT/BIC in res_bank

Thanks,
ara
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-805996-ara/+merge/68646
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-805996-ara.
=== modified file 'base_iban/base_iban.py'
--- base_iban/base_iban.py	2011-01-14 09:34:28 +0000
+++ base_iban/base_iban.py	2011-07-21 09:19:25 +0000
@@ -120,6 +120,15 @@
             return _('The IBAN does not seem to be correct. You should have entered something like this %s'), (iban_example)
         return _('The IBAN is invalid, It should begin with the country code'), ()
 
+    def _check_bank(self, cr, uid, ids, context=None):
+        if context is None:
+            context = {}
+        banks = self.browse(cr, uid, ids, context=context)
+        for bank in banks:
+            if bank.state == 'iban' and not bank.bank.bic:
+                return False
+        return True
+
     def name_get(self, cr, uid, ids, context=None):
         res = []
         to_check_ids = []
@@ -172,8 +181,7 @@
     _columns = {
         'iban': fields.char('IBAN', size=34, readonly=True, help="International Bank Account Number"),
     }
-
-    _constraints = [(check_iban, _construct_constraint_msg, ["iban"])]
+    _constraints = [(check_iban, _construct_constraint_msg, ["iban"]), (_check_bank, '\nPlease define BIC/Swift code on bank for bank type IBAN Account to make valid payments', ['BIC/Swift code'])]
 
 res_partner_bank()
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to