8168aceff9f0899a417f1c9e0e4ef82f1b9ed12d
1 # -*- coding: utf-8 -*-
2 from openerp
.osv
import fields
, osv
3 import openerp
.addons
.decimal_precision
as dp
7 _name
= 'bikecoop.partner.theme'
8 _description
= 'Themes that could be related to a partner'
11 'code': fields
.char('Code', size
=8, help='Code of the occupation'),
12 'name': fields
.char('Name', size
=128, help='Name of the job or studies', required
=True, translate
=True),
13 'domain': fields
.selection([('gender', 'Gender'), ('occupation', 'Occupation'), ('volunteer', 'Volunteer')], 'Domain', required
=True, size
=24),
14 'active': fields
.boolean('Active', help='If check, this object is always available'),
18 'active': lambda *a
: 1,
24 class Partner(osv
.osv
):
25 _inherit
= 'res.partner'
28 'nationality_id': fields
.many2one('res.country', 'Nationality', help='Partner\'s nationality if he is a person'),
29 'year': fields
.integer('Year of birth', help='This partner year of birth'),
30 'occupation_id': fields
.many2one('bikecoop.partner.theme', 'Occupation', help='Main occupation of this partner'),
31 'volunteer_ids': fields
.many2many('bikecoop.partner.theme', 'res_partner_bikecoop_theme_rel', 'partner_id', 'theme_id', 'Want to be volunteer?', help='What kind of volunteer activities you want to do with us?'),
32 'gender_id': fields
.many2one('bikecoop.partner.theme', 'Gender'),
35 def _check_year(self
, cr
, uid
, ids
, context
=None):
36 obj
= self
.browse(cr
, uid
, ids
[0], context
=context
)
38 if obj
.year
< 1900 or obj
.year
> 2100:
43 (_check_year
, 'Error: this year is not valid.', ['year']),
50 class product_template(osv
.osv
):
51 _inherit
= 'product.template'
54 'standard_price': fields
.float('Cost', digits_compute
=dp
.get_precision('Product Price'), help="Cost price of the product used for standard stock valuation in accounting and used as a base price on purchase orders.", groups
="base.group_user,point_of_sale.group_pos_user"),
60 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: