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

language-flags module gives server error

By
Maurice Matheeussen
on 6/22/15, 3:28 PM 830 views

After installing the module language-flags, I get an internal server error and my website does not display anymore.

Does anyone encountered this already an have a solution for this ?

0
Frank Leysen
On 9/27/15, 4:43 AM

I tried Maurice Matheeussen's solution, but that did not work for me. I can't find a models directory. Can you help me out? Thanks.

0
Maurice Matheeussen
On 6/26/15, 2:28 AM

In the mean time I have found a solution myself


add a file ir_http.py with the following content to the website_language_flags module in the models directory.



import openerp

from openerp.osv import orm, osv, fields

from openerp.http import request

class ir_http(orm.AbstractModel):

_inherit="ir.http"

def get_nearest_lang(self, lang):

# Try to find a similar lang. Eg: fr_BE and fr_FR

if lang in request.website.get_languages():

return lang

short = lang.split('_')[0]

for code, name, lang_obj in request.website.get_languages():

if code.startswith(short):

return code

return False

ir_http()

 

0

Ermin Trevisan

--Ermin Trevisan--
3546
| 6 3 7
Walchwil, Switzerland
--Ermin Trevisan--


Ermin Trevisan
On 6/25/15, 5:35 AM

I do not have a crystal ball, so unfortunately I'm not able to look into your odoo server's log file.

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: 6/22/15, 3:28 PM
Seen: 830 times
Last updated: 9/27/15, 4:43 AM