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

Sudden error after testing languages in web site

By
Marius Stedjan
on 2/26/16, 4:31 PM 400 views

After playing around with the settings for languages in the web site module, I get this error:

werkzeug: Error on request:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi

execute(self.server.app)

File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute

application_iter = app(environ, start_response)

File "/opt/odoo/odoo9/openerp/service/wsgi_server.py", line 184, in application

return application_unproxied(environ, start_response)

File "/opt/odoo/odoo9/openerp/service/wsgi_server.py", line 170, in application_unproxied

result = handler(environ, start_response)

File "/opt/odoo/odoo9/openerp/http.py", line 1488, in __call__

return self.dispatch(environ, start_response)

File "/opt/odoo/odoo9/openerp/http.py", line 1462, in __call__

return self.app(environ, start_wrapped)

File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in __call__

return self.app(environ, start_response)

File "/opt/odoo/odoo9/openerp/http.py", line 1652, in dispatch

result = ir_http._dispatch()

File "/opt/odoo/addons_ent/website_sale/models/ir_http.py", line 12, in _dispatch

return super(IrHttp, self)._dispatch()

File "/opt/odoo/addons_ent/website_version/models/ir_http.py", line 11, in _dispatch

x = super(ir_http, self)._dispatch()

File "/opt/odoo/addons_ent/utm/models/ir_http.py", line 13, in _dispatch

response = super(ir_http, self)._dispatch()

File "/opt/odoo/addons_ent/website/models/ir_http.py", line 193, in _dispatch

resp.set_cookie('website_lang', request.lang)

File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in set_cookie

self.charset))

File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_cookie

value = to_bytes(value, charset)

File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_bytes

raise TypeError('Expected bytes')


Anyone knows what causes this?
The database was working fine until it suddenly started throwing this error.
Creating a new blank database works.

Çan You print request.lang in website / ir http line 193 ...

Jérémy Kersten (jke)
on 2/26/16, 5:11 PM

I'm not sure what you are asking me to do. How do I print request.lang in webside / ir http line 193?

Marius Stedjan
on 2/26/16, 5:15 PM

When I put a print statement in the ir_http.py just after request.lang = request.context.... it prints as "False"

Marius Stedjan
on 2/26/16, 5:39 PM

Now I am able to log in again. I checked the records in the website db-table. "default_lang_id" and "default_lang_code" was set to false, so I set them to English (id 1) and en_US. However, I get an error in the "Website Admin -> Configure" view. I got this before the previously posted error: openerp.http: Exception during JSON request handling. Traceback (most recent call last): File "/opt/odoo/odoo9/openerp/http.py", line 643, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo9/openerp/http.py", line 680, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo9/openerp/http.py", line 316, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo9/openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo9/openerp/http.py", line 309, in checked_call result = self.endpoint(*a, **kw) File "/opt/odoo/odoo9/openerp/http.py", line 959, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo9/openerp/http.py", line 509, in response_wrap response = f(*args, **kw) File "/opt/odoo/addons_ent/web/controllers/main.py", line 907, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/odoo/addons_ent/web/controllers/main.py", line 899, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo9/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo9/openerp/api.py", line 381, in old_api result = method(recs, *args, **kwargs) File "/opt/odoo/odoo9/openerp/models.py", line 6034, in onchange record._onchange_eval(name, field_onchange[name], result) File "/opt/odoo/odoo9/openerp/models.py", line 5938, in _onchange_eval method_res = getattr(self._model, method)(*args, context=self._context) File "/opt/odoo/odoo9/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/addons_ent/website/models/res_config.py", line 34, in on_change_website_id website_data = self.pool.get('website').read(cr, uid, [website_id], [], context=context)[0] File "/opt/odoo/odoo9/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo9/openerp/models.py", line 3174, in read result = BaseModel.read(records, fields, load=load) File "/opt/odoo/odoo9/openerp/api.py", line 248, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo9/openerp/models.py", line 3209, in read self._read_from_database(stored, inherited) File "/opt/odoo/odoo9/openerp/api.py", line 248, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo9/openerp/models.py", line 3400, in _read_from_database res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result) File "/opt/odoo/odoo9/openerp/osv/fields.py", line 1494, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/opt/odoo/addons_ent/website_sale/models/sale_order.py", line 142, in _get_pricelist_id pricelist = self.get_current_pricelist(cr, uid, context=context) File "/opt/odoo/odoo9/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/addons_ent/website_sale/models/sale_order.py", line 225, in get_current_pricelist available_pricelists = self.get_pricelist_available(cr, uid, context=context) File "/opt/odoo/odoo9/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/addons_ent/website_sale/models/sale_order.py", line 203, in get_pricelist_available request.website.user_id.sudo().partner_id.property_product_pricelist.id, AttributeError: 'NoneType' object has no attribute 'user_id'

Marius Stedjan
on 2/26/16, 6:27 PM

Every time I try to change settings in "Website Admin - Configure" the original error occurs. Seems like it resets the default_lang_id and default_lang_code and that causes the problem.

Marius Stedjan
on 2/26/16, 6:37 PM
0
Marius Stedjan
On 4/9/16, 9:03 PM

This error was fixed by simply pulling the latest Enterprise code.

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: 2/26/16, 4:31 PM
Seen: 400 times
Last updated: 4/9/16, 9:03 PM