Skip to content
Snippets Groups Projects
Commit d5f35bf3 authored by Raphael Collet's avatar Raphael Collet
Browse files

[FIX] res_lang: prevent modification of language code

parent b0a4dd01
Branches
Tags
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment