Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Getting "openerp.tools.safe_eval: Cannot eval '# -*- encoding: utf-8 " error. Please can any one help me?

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
3 Respostas
7535 Visualizações
Avatar
samba

 I want to migrate my code and databases to ubuntu 12.04 Lts to cent os  cloud server. I have installed all dependencies and copied my code to cent os server using scp command and restored my database. When i run  odoo server without including custom modules folder(./openerp-server --addons ./addons) my database working fine. When i include custom modules (./openerp-server --addons ./addons,./custom_modules). I am getting below error.

2015-02-05 12:39:14,811 16954 INFO pinatascom openerp.modules.loading: loading 1 modules...
2015-02-05 12:39:14,826 16954 ERROR pinatascom openerp.tools.safe_eval: Cannot eval '# -*- encoding: utf-8 -*-\r\n#################################################################################\r\n#                                                                               \r\n#    base_onchange_player for OpenERP                                           \r\n#    Copyright (C) 2011 Akretion S\xc3\xa9bastien BEAU <sebastien.beau@akretion.com>   \r\n#                                                                               \r\n#    This program is free software: you can redistribute it and/or modify       \r\n#    it under the terms of the GNU Affero General Public License as             \r\n#    published by the Free Software Foundation, either version 3 of the         \r\n#    License, or (at your option) any later version.                            \r\n#                                                                               \r\n#    This program is distributed in the hope that it will be useful,            \r\n#    but WITHOUT ANY WARRANTY; without even the implied warranty of             \r\n#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              \r\n#    GNU Affero General Public License for more details.                        \r\n#                                                                               \r\n#    You should have received a copy of the GNU Affero General Public License   \r\n#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      \r\n#                                                                               \r\n#################################################################################\r\n\r\n\r\n{\r\n    \'name\': \'base_onchange_player\',\r\n    \'version\': \'0.1\',\r\n    \'category\': \'ORM Extention\',\r\n    \'license\': \'AGPL-3\',\r\n    \'description\': """This module give the possibility to call onchange method easily in your code, it\'s just an Abstract Module that add some abstraction when you need to call onchange method.\r\n        A sample of call is done in the module base_sale_multichannels\r\n        """,\r\n    \'author\': \'Akretion\',\r\n    \'website\': \'http://www.akretion.com/\',\r\n    \'depends\': [\'base\'], \r\n    \'init_xml\': [],\r\n    \'update_xml\': [\r\n    ],\r\n    \'demo_xml\': [],\r\n    \'installable\': True,\r\n    \'active\': False,\r\n}\r\n\r\n'
Traceback (most recent call last):
  File "/home/praveen/odoo-7-2015-01-12/openerp/tools/safe_eval.py", line 287, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "/home/praveen/odoo-7-2015-01-12/openerp/tools/safe_eval.py", line 161, in test_expr
    code_obj = compile(expr, "", mode)
  File "<string>", line 21
     
    ^
 SyntaxError: invalid syntax
2015-02-05 12:39:14,826 16954 ERROR pinatascom openerp.netsvc: invalid syntax
('', 21, 1, '\r\n')
Traceback (most recent call last):
  File "/home/praveen/odoo-7-2015-01-12/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/praveen/odoo-7-2015-01-12/openerp/service/web_services.py", line 622, in dispatch
    security.check(db,uid,passwd)
  File "/home/praveen/odoo-7-2015-01-12/openerp/service/security.py", line 40, in check
    pool = pooler.get_pool(db)
  File "/home/praveen/odoo-7-2015-01-12/openerp/pooler.py", line 49, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/home/praveen/odoo-7-2015-01-12/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/registry.py", line 203, in get
    update_module)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/registry.py", line 233, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/loading.py", line 254, in load_marked_modules
    graph.add_modules(cr, module_list, force)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/graph.py", line 102, in add_modules
    info = openerp.modules.module.load_information_from_description_file(module)
  File "/home/praveen/odoo-7-2015-01-12/openerp/modules/module.py", line 344, in load_information_from_description_file
    info.update(eval(f.read()))
  File "/home/praveen/odoo-7-2015-01-12/openerp/tools/safe_eval.py", line 287, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "/home/praveen/odoo-7-2015-01-12/openerp/tools/safe_eval.py", line 161, in test_expr
    code_obj = compile(expr, "", mode)
  File "<string>", line 21
     
    ^
 SyntaxError: invalid syntax
2015-02-05 12:39:14,831 16954 INFO pinatascom werkzeug: 183.82.101.76 - - [05/Feb/2015 12:39:14] "POST /web/action/load HTTP/1.1" 200 -
2015-02-05 12:39:15,247 16954 INFO ? werkzeug: 183.82.101.76 - - [05/Feb/2015 12:39:15] "GET /web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png HTTP/1.1" 304 -
^[[1;2B

Can any one please help me?

0
Avatar
Cancelar
Avatar
Ivan
Melhor resposta

It looks like the file has been altered to use Win32 style line breaks while you're running OpenERP in Linux.  Try to convert it to Unix style line breaks first.  Follow the instruction here.

3
Avatar
Cancelar
samba
Autor

Thank you Ivan. But i am running my server in Centos not in windows

samba
Autor

Great! working fine

Ivan

A bit late, but that is exactly the problem @samba. It seems that you are using Win32 encoded file in Linux environment.

Avatar
Deepa Venkatesh
Melhor resposta

Looks like __openerp__.py("base_onchange_player")  file is corrupted ... may be some junk character/data has got added to that file, do have a look it...

I had also faced the same error, so do check it out

1
Avatar
Cancelar
Avatar
Zbik
Melhor resposta

In your file I see '\r\n', @Ivan answer is right. '\n' writes a newline in UNIX while for Windows there is the two character sequence: '\r\n'

1
Avatar
Cancelar
samba
Autor

Thank you Zbik. But i am running my server in Centos not in windows. Previously my code in ubuntu. I have transfered my code using scp command to centos server.

Zbik

Centos = Unix, why do you have in your file '\r\n\???

samba
Autor

How can i change it?

Zbik

Link in @Ivan post.

samba
Autor

Thank you Zbik

Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now