Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
3 Replies
7533 Zobrazenia
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
Zrušiť
Avatar
Ivan
Best Answer

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
Zrušiť
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
Best Answer

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
Zrušiť
Avatar
Zbik
Best Answer

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
Zrušiť
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!

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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