[PARTNER] +country_id and nationality_id default value is 'France'
[burette/bikecoop_l10n_fr.git] / bikecoop.py
1 from openerp.osv import osv
2 from openerp.osv import fields
3
4 class Partner(osv.osv):
5 _inherit = 'res.partner'
6
7 def _default_country(self, cr, uid, context=None):
8 if not context:
9 context = {}
10 country_obj = self.pool.get('res.country')
11 country = country_obj.search(cr, uid, [('name', '=', 'France')], context=context)
12 return country
13
14 def _default_nationality(self, cr, uid, context=None):
15 if not context:
16 context = {}
17 nationality_obj = self.pool.get('res.country')
18 nationality = nationality_obj.search(cr, uid, [('name', '=', 'France')], context=context)
19 return nationality
20
21 _defaults = {
22 'country_id': _default_country,
23 'nationality_id': _default_nationality,
24 }
25
26 Partner()
27