1 # -*- coding: utf-8 -*-
6 # Created by Nicolas Bessi based on Credric Krier contribution
8 # Copyright (c) 2009 CamptoCamp. All rights reserved.
9 ##############################################################################
10 # WARNING: This program as such is intended to be used by professional
11 # programmers who take the whole responsability of assessing all potential
12 # consequences resulting from its eventual inadequacies and bugs
13 # End users who are looking for a ready-to-use solution with commercial
14 # garantees and support are strongly adviced to contract a Free Software
17 # This program is Free Software; you can redistribute it and/or
18 # modify it under the terms of the GNU General Public License
19 # as published by the Free Software Foundation; either version 2
20 # of the License, or (at your option) any later version.
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write to the Free Software
29 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 ##############################################################################
33 from osv import fields, osv
35 class res_partner(osv.osv):
36 _inherit = 'res.partner'
39 'ref_companies': fields.one2many('res.company', 'partner_id',
40 'Companies that refers to partner'),
45 class res_partner_bank(osv.osv):
46 _inherit = "res.partner.bank"
48 'name': fields.char('Description', size=128, required=True),
49 'post_number': fields.char('Post number', size=64),
50 'bvr_number': fields.char('BVR account number', size=11),
51 'bvr_adherent_num': fields.char('BVR adherent number', size=11),
52 'dta_code': fields.char('DTA code', size=5),
55 def name_get(self, cr, uid, ids, context=None):
58 bank_type_obj = self.pool.get('res.partner.bank.type')
60 type_ids = bank_type_obj.search(cr, uid, [])
62 for bank_type in bank_type_obj.browse(cr, uid, type_ids,
64 bank_type_names[bank_type.code] = bank_type.name
66 for r in self.read(cr, uid, ids, ['name','state'], context):
67 res.append((r['id'], r['name']+' : '+bank_type_names[r['state']]))
71 ('bvr_adherent_uniq', 'unique (bvr_adherent_num)', 'The BVR adherent number must be unique !')
76 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: