[FIX] res_lang: prevent modification of language code
This commit is contained in:
parent
b0a4dd0127
commit
d5f35bf37d
|
@ -181,6 +181,10 @@ class lang(osv.osv):
|
|||
return grouping, thousands_sep, decimal_point
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'code' in vals:
|
||||
for lang in self.browse(cr, uid, ids, context):
|
||||
if lang.code != vals['code']:
|
||||
raise osv.except_osv(_('User Error'), _("Language code cannot be modified."))
|
||||
for lang_id in ids :
|
||||
self._lang_data_get.clear_cache(self)
|
||||
return super(lang, self).write(cr, uid, ids, vals, context)
|
||||
|
|
Loading…
Reference in New Issue