1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
6 # Created by Luc De Meyer
7 # Copyright (c) 2010 Noviat nv/sa (www.noviat.be). All rights reserved.
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.
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.
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/>.
22 ##############################################################################
24 from osv import fields, osv
26 from tools.translate import _
28 logger=netsvc.Logger()
30 class res_partner(osv.osv):
31 """ add field to indicate default 'Communication Type' on customer invoices """
32 _inherit = 'res.partner'
34 def _get_comm_type(self, cr, uid, context=None):
35 res = self.pool.get('account.invoice')._get_reference_type(cr, uid,context=context)
39 'out_inv_comm_type': fields.selection(_get_comm_type, 'Communication Type', change_default=True,
40 help='Select Default Communication Type for Outgoing Invoices.' ),
41 'out_inv_comm_algorithm': fields.selection([
44 ('partner_ref','Customer Reference'),
45 ], 'Communication Algorithm',
46 help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ),
50 'out_inv_comm_type': 'none',
54 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: