Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
3 Răspunsuri
7537 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Ivan
Cel mai bun răspuns

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
Imagine profil
Abandonează
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.

Imagine profil
Deepa Venkatesh
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Zbik
Cel mai bun răspuns

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
Imagine profil
Abandonează
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

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

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