Odoo Help

Welcome!

This community 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.

0

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

By
Roberto Taglioretti
on 1/9/14, 5:50 PM 1,284 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': [],
   'test':[],
   '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?

Petar
on 1/12/14, 9:26 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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