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 openerp.osv import fields, osv
26 from openerp.tools.translate import _
28 class res_partner(osv.osv):
29 """ add field to indicate default 'Communication Type' on customer invoices """
30 _inherit = 'res.partner'
32 def _get_comm_type(self, cr, uid, context=None):
33 res = self.pool.get('account.invoice')._get_reference_type(cr, uid,context=context)
37 'out_inv_comm_type': fields.selection(_get_comm_type, 'Communication Type', change_default=True,
38 help='Select Default Communication Type for Outgoing Invoices.' ),
39 'out_inv_comm_algorithm': fields.selection([
42 ('partner_ref','Customer Reference'),
43 ], 'Communication Algorithm',
44 help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ),
47 def _commercial_fields(self, cr, uid, context=None):
48 return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \
49 ['out_inv_comm_type', 'out_inv_comm_algorithm']
53 'out_inv_comm_type': 'none',
56 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: