[FIX] remove default value set in partner.
bzr revid: ysa@tinyerp.com-20110103121949-ayvs047l94jzeyq5
This commit is contained in:
parent
8b7e75c8c2
commit
470f98b9d4
|
@ -149,7 +149,6 @@ class res_partner(osv.osv):
|
||||||
'customer': lambda *a: 1,
|
'customer': lambda *a: 1,
|
||||||
'category_id': _default_category,
|
'category_id': _default_category,
|
||||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'res.partner', context=c),
|
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'res.partner', context=c),
|
||||||
'lang': lambda self, cr, uid, context: context.get('lang',False) or tools.config.get('lang', False)
|
|
||||||
}
|
}
|
||||||
def copy(self, cr, uid, id, default={}, context={}):
|
def copy(self, cr, uid, id, default={}, context={}):
|
||||||
name = self.read(cr, uid, [id], ['name'])[0]['name']
|
name = self.read(cr, uid, [id], ['name'])[0]['name']
|
||||||
|
|
|
@ -32,9 +32,9 @@ class lang(osv.osv):
|
||||||
_description = "Languages"
|
_description = "Languages"
|
||||||
|
|
||||||
def install_lang(self, cr, uid, **args):
|
def install_lang(self, cr, uid, **args):
|
||||||
avil_ids = self.search(cr, uid, [('code','=', tools.config.get('lang'))])
|
lang_ids = self.search(cr, uid, [('code','=', tools.config.get('lang'))])
|
||||||
if not avil_ids:
|
if not lang_ids:
|
||||||
self.load_lang(cr, uid, tools.config.get('lang'))
|
lang_id = self.load_lang(cr, uid, tools.config.get('lang'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def load_lang(self, cr, uid, lang, lang_name=None):
|
def load_lang(self, cr, uid, lang, lang_name=None):
|
||||||
|
@ -73,12 +73,13 @@ class lang(osv.osv):
|
||||||
'decimal_point' : fix_xa0(str(locale.localeconv()['decimal_point'])),
|
'decimal_point' : fix_xa0(str(locale.localeconv()['decimal_point'])),
|
||||||
'thousands_sep' : fix_xa0(str(locale.localeconv()['thousands_sep'])),
|
'thousands_sep' : fix_xa0(str(locale.localeconv()['thousands_sep'])),
|
||||||
}
|
}
|
||||||
|
lang_id = False
|
||||||
try:
|
try:
|
||||||
self.create(cr, uid, lang_info)
|
lang_id = self.create(cr, uid, lang_info)
|
||||||
|
self.pool.get('ir.values').set(cr, uid, 'default', False, 'lang', ['res.partner'], lang)
|
||||||
finally:
|
finally:
|
||||||
tools.resetlocale()
|
tools.resetlocale()
|
||||||
return True
|
return lang_id
|
||||||
|
|
||||||
def _get_default_date_format(self,cursor,user,context={}):
|
def _get_default_date_format(self,cursor,user,context={}):
|
||||||
return '%m/%d/%Y'
|
return '%m/%d/%Y'
|
||||||
|
|
Loading…
Reference in New Issue