~openerp-dev/openobject-server/printscreen_group_no_lief

« back to all changes in this revision

Viewing changes to bin/addons/base/res/partner/partner.py

[Merge] trunk-dev-framework

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
##############################################################################
3
 
#    
 
3
#
4
4
#    OpenERP, Open Source Management Solution
5
5
#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
6
6
#
15
15
#    GNU Affero General Public License for more details.
16
16
#
17
17
#    You should have received a copy of the GNU Affero General Public License
18
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
 
18
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
19
#
20
20
##############################################################################
21
21
 
27
27
import pooler
28
28
from tools.translate import _
29
29
 
30
 
class res_partner_function(osv.osv):
31
 
    _name = 'res.partner.function'
32
 
    _description = 'Function of the contact'
33
 
    _columns = {
34
 
        'name': fields.char('Function Name', size=64, required=True),
35
 
        'code': fields.char('Code', size=8, required=True),
36
 
        'ref':fields.char('Notes', size=32,),
37
 
    }
38
 
    _order = 'name'
39
 
    _sql_constraints = [
40
 
        ('code_uniq', 'unique (code)', 'The Code of the Partner Function must be unique !')
41
 
    ]
42
 
res_partner_function()
43
 
 
44
 
 
45
30
class res_payterm(osv.osv):
46
31
    _description = 'Payment term'
47
32
    _name = 'res.payterm'
149
134
        'active': fields.boolean('Active'),
150
135
        'customer': fields.boolean('Customer', help="Check this box if the partner is a customer."),
151
136
        'supplier': fields.boolean('Supplier', help="Check this box if the partner is a supplier. If it's not checked, purchase people will not see it when encoding a purchase order."),
152
 
        'city': fields.related('address', 'city', type='char', string='City'), 
153
 
        'phone': fields.related('address', 'phone', type='char', string='Phone'), 
 
137
        'city': fields.related('address', 'city', type='char', string='City'),
 
138
        'phone': fields.related('address', 'phone', type='char', string='Phone'),
154
139
        'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
155
140
        'employee': fields.boolean('Employee', help="Check this box if the partner is an Employee."),
156
141
        'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
157
 
        'company_id': fields.many2one('res.company', 'Company', select=1), 
 
142
        'company_id': fields.many2one('res.company', 'Company', select=1),
158
143
    }
159
144
 
160
145
    def _default_category(self, cr, uid, context={}):
291
276
    _columns = {
292
277
        'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', select=True, help="Keep empty for a private address, not related to partner."),
293
278
        'type': fields.selection( [ ('default','Default'),('invoice','Invoice'), ('delivery','Delivery'), ('contact','Contact'), ('other','Other') ],'Address Type', help="Used to select automatically the right address according to the context in sales and purchases documents."),
294
 
        'function': fields.many2one('res.partner.function', 'Function'),
 
279
        'function': fields.char('Function', size=64),
295
280
        'title': fields.selection(_contact_title_get, 'Title', size=32),
296
281
        'name': fields.char('Contact Name', size=64, select=1),
297
282
        'street': fields.char('Street', size=128),
469
454
    _columns = {
470
455
        'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
471
456
    }
472
 
   
 
457
 
473
458
res_partner_category()
474
459
 
475
460
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: