[IMP] logging: use logging instead of netsvc, use module __name__ instead of somethin...
[odoo/odoo.git] / addons / l10n_be_invoice_bba / partner.py
1 # -*- encoding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    
6 #    Created by Luc De Meyer
7 #    Copyright (c) 2010 Noviat nv/sa (www.noviat.be). All rights reserved.
8
9 #    This program is free software: you can redistribute it and/or modify
10 #    it under the terms of the GNU General Public License as published by
11 #    the Free Software Foundation, either version 3 of the License, or
12 #    (at your option) any later version.
13 #
14 #    This program is distributed in the hope that it will be useful,
15 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
16 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 #    GNU General Public License for more details.
18 #
19 #    You should have received a copy of the GNU General Public License
20 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 #
22 ##############################################################################
23
24 import time
25
26 from osv import fields, osv
27 from tools.translate import _
28
29 class res_partner(osv.osv):  
30     """ add field to indicate default 'Communication Type' on customer invoices """
31     _inherit = 'res.partner'
32     
33     def _get_comm_type(self, cr, uid, context=None):
34         res = self.pool.get('account.invoice')._get_reference_type(cr, uid,context=context)
35         return res
36     
37     _columns = {
38         'out_inv_comm_type': fields.selection(_get_comm_type, 'Communication Type', change_default=True,
39             help='Select Default Communication Type for Outgoing Invoices.' ),
40         'out_inv_comm_algorithm': fields.selection([
41             ('random','Random'),
42             ('date','Date'),
43             ('partner_ref','Customer Reference'),
44             ], 'Communication Algorithm',
45             help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ),
46     }
47
48     _default = {
49         'out_inv_comm_type': 'none',
50     }
51 res_partner()    
52
53 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: