1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# account module for OpenERP
5
# Copyright (C) 2010 Tecnoba S.L. (http://www.tecnoba.com)
6
# Pere Ramon Erro Mas <pereerro@tecnoba.com> All Rights Reserved.
9
# account_contact OpenERP module 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
# account_contact OpenERP module 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
##############################################################################
25
from osv import osv, fields
26
from datetime import datetime, date, timedelta
27
from tools.translate import _
28
from collections import defaultdict
30
from membership.membership import STATE
33
class res_partner_contact(osv.osv):
34
_inherit = 'res.partner.contact'
36
def _get_phone(self, cr, uid, ids, field_name, arg, context=None):
38
for item in self.browse(cr, uid, ids):
39
ret[item.id] = item.job_ids and item.job_ids[0].phone
43
'direct_job_ids' : fields.one2many('res.partner.job', 'contact_id', string='Jobs',),
44
'phone' : fields.function(_get_phone, type='char', size=60, method=True,),
48
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: