1. ukoma
  2. party_bank

Commits

Mathias Behrle  committed 015d96c

New interface for Function/Property fields.

  • Participants
  • Parent commits ae2d3ee
  • Branches default

Comments (0)

Files changed (1)

File bank.py

View file
  • Ignore whitespace
     bank_code = fields.Char('National Code', select=1)
     bic = fields.Char('BIC/SWIFT', select=1)
 
-    def get_rec_name(self, cursor, user, ids, name, arg, context=None):
+    def get_rec_name(self, cursor, user, ids, name, context=None):
         if not ids:
             return {}
         res = {}
     iban = fields.Char('IBAN')
     bank = fields.Many2One('bank.bank', 'Bank', required=True,
                            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')
+    bank_code = fields.Function(fields.Char('National Code'),
+            'get_bank_code')
+    bic = fields.Function(fields.Char('BIC/SWIFT'), 'get_bic')
     currency = fields.Many2One('currency.currency', 'Currency')
     party = fields.Many2One('party.party', 'Party',
                             ondelete='CASCADE', required=True)
         if table.column_exist('name'):
             table.drop_column('name', exception=True)
 
-    def get_rec_name(self, cursor, user, ids, name, arg, context=None):
+    def get_rec_name(self, cursor, user, ids, name, context=None):
         if not ids:
             return {}
         res = {}
                         account.bic] if x)
         return res
 
-    def get_bank_code(self, cursor, user, ids, name, arg, context=None):
+    def get_bank_code(self, cursor, user, ids, name, context=None):
         res = {}
         for account in self.browse(cursor, user, ids, context=context):
             res[account.id] = account.bank.bank_code
         return res
 
-    def get_bic(self, cursor, user, ids, name, arg, context=None):
+    def get_bic(self, cursor, user, ids, name, context=None):
         res = {}
         for account in self.browse(cursor, user, ids, context=context):
             res[account.id] = account.bank.bic