Korbinian Preisler avatar Korbinian Preisler committed de8962b

Guidelines

Comments (0)

Files changed (1)

     bic = fields.Char('BIC/SWIFT', select=1)
 
     def get_rec_name(self, cursor, user, ids, name, arg, context=None):
+        res = {}
         if not ids:
-            return {}
-        res = {}
+            return res
         for bank in self.browse(cursor, user, ids, context=context):
-            res[bank.id] = ", ".join(x for x in [bank.name, bank.bank_code,
-                                                 bank.bic] if x)
+            res[bank.id] = ", ".join(
+                     x for x in [bank.name, bank.bank_code, bank.bic] if x)
         return res
 
     def search_rec_name(self, cursor, user, name, args, context=None):
                     args2.append(('bank_code', args[i][1], args[i][2]))
                 else:
                     ids = self.search(cursor, user, [
-                                 ('bic', args[i][1], args[i][2]),
-                                 ], limit=1, context=context)
+                        ('bic', args[i][1], args[i][2]),
+                        ], limit=1, context=context)
                     if ids:
                         args2.append(('bic', args[i][1], args[i][2]))
                     else:
     code = fields.Char('Account Number', help='National Standard Code')
     iban = fields.Char('IBAN')
     bank = fields.Many2One('bank.bank', 'Bank', required=True,
-                           on_change=['bank'])
+            on_change=['bank'])
     bank_code = fields.Function('get_bank_code', type='char',
             string='National Code')
-    bic = fields.Function('get_bic', type='char',
-            string='BIC/SWIFT')
+    bic = fields.Function('get_bic', type='char', string='BIC/SWIFT')
     currency = fields.Many2One('currency.currency', 'Currency')
-    party = fields.Many2One('party.party', 'Party',
-                            ondelete='CASCADE', required=True)
+    party = fields.Many2One('party.party', 'Party', ondelete='CASCADE',
+            required=True)
     owner = fields.Char('Differing Owner')
 
     def init(self, cursor, module_name):
             table.drop_column('name', exception=True)
 
     def get_rec_name(self, cursor, user, ids, name, arg, context=None):
+        res = {}
         if not ids:
-            return {}
-        res = {}
+            return res
         for account in self.browse(cursor, user, ids, context=context):
             res[account.id] = ", ".join(x for x in [account.bank.name,
-                        account.code, account.bank_code, account.iban,
-                        account.bic] if x)
+                    account.code, account.bank_code, account.iban,
+                    account.bic] if x)
         return res
 
     def get_bank_code(self, cursor, user, ids, name, arg, context=None):
 
     def on_change_bank(self, cursor, user, ids, vals, context=None):
         bank_obj = self.pool.get('bank.bank')
-        res = {'bank_code': None,
-               'bic': None}
-
+        res = {
+           'bank_code': False,
+           'bic': False
+           }
         if vals.get('bank'):
-            bank = bank_obj.browse(cursor, user, vals.get('bank'),
-                                context=context)
+            bank = bank_obj.browse(cursor, user, vals['bank'],
+                    context=context)
             if bank:
                 res['bank_code'] = bank.bank_code
                 res['bic'] = bank.bic
         return res
 
-BankAccount()
+BankAccount()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.