Odoo Help


module to add a field to partner database gives error KeyError: 'lang'

Roberto Taglioretti
on 1/9/14, 5:50 PM 1,703 views

I tried to develop a small module in openerp v 7, but after the installation openerp gives me this error:

File "/usr/local/data/openerp/7.0/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params)
File "/usr/local/data/openerp/7.0/openerp/addons/web/controllers/main.py", line 867, in authenticate req.session.authenticate(db, login, password, env)
File "/usr/local/data/openerp/7.0/openerp/addons/web/session.py", line 118, in authenticate if uid: self.get_context()
File "/usr/local/data/openerp/7.0/openerp/addons/web/session.py", line 172, in get_context self._fix_lang(self.context)
File "/usr/local/data/openerp/7.0/openerp/addons/web/session.py", line 183, in _fix_lang lang = context['lang']
KeyError: 'lang'

Here are the source codes:

FILE __openerp__.py
   'name': 'Psl1',
   'version': '0.8',
   'category': 'Tools',
   'description': "prove psl aggiunta campo",
   'author': 'RT',
   'website': 'progettols',
   depends': ['base'],
   'data': [],
   'demo': [],
   'installable': True,
   'images': [],

FILE __init__.py
import psl1

FILE psl1.py
from openerp.osv import osv
from openerp.osv import fields

class res_partner(osv.osv):
   _name = 'res.partner'
   __inherit = 'res.partner'
   _columns = {
   'specialcode':fields.char('Internal specialcode',size=64),

could someone help me to understand the error ?

Apparently expected value 'lang' is not found in the context for some reason. Have you tried running it on a fresh/new database?

on 1/12/14, 9:26 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/9/14, 5:50 PM
Seen: 1703 times
Last updated: 3/16/15, 8:10 AM