This question has been flagged
5 Replies
6131 Views

I am getting this error after deleted and adding some custom fields to my product module.

SyntaxError: unexpected EOF while parsing2017-02-20 17:46:11,028 5060 INFO epower werkzeug: 169.54.173.133 - - [20/Feb/2017 17:46:11] "POST /longpolling/poll HTTP/1.0" 500 -2017-02-20 17:46:11,042 5060 ERROR epower werkzeug: Error on request: Traceback (most recent call last): File "werkzeug\serving.py", line 177, in run_wsgi File "werkzeug\serving.py", line 165, in execute File "E:\ePower\Odoo 10.0\server\odoo\service\server.py", line 246, in app return self.app(e, s) File "E:\ePower\Odoo 10.0\server\odoo\service\wsgi_server.py", line 184, in application return application_unproxied(environ, start_response) File "E:\ePower\Odoo 10.0\server\odoo\service\wsgi_server.py", line 170, in application_unproxied result = handler(environ, start_response) File "E:\ePower\Odoo 10.0\server\odoo\http.py", line 1306, in __call__ return self.dispatch(environ, start_response) File "E:\ePower\Odoo 10.0\server\odoo\http.py", line 1280, in __call__ return self.app(environ, start_wrapped) File "werkzeug\wsgi.py", line 579, in __call__ File "E:\ePower\Odoo 10.0\server\odoo\http.py", line 1454, in dispatch odoo.registry(db).check_signaling() File "E:\ePower\Odoo 10.0\server\odoo\__init__.py", line 55, in registry return modules.registry.Registry(database_name) File "E:\ePower\Odoo 10.0\server\odoo\modules\registry.py", line 55, in __new__ return cls.new(db_name) File "E:\ePower\Odoo 10.0\server\odoo\modules\registry.py", line 78, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "E:\ePower\Odoo 10.0\server\odoo\modules\loading.py", line 333, in load_modules force, status, report, loaded_modules, update_module) File "E:\ePower\Odoo 10.0\server\odoo\modules\loading.py", line 235, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "E:\ePower\Odoo 10.0\server\odoo\modules\loading.py", line 135, in load_module_graph registry.setup_models(cr, partial=True) File "E:\ePower\Odoo 10.0\server\odoo\modules\registry.py", line 290, in setup_models model._setup_base(partial) File "E:\ePower\Odoo 10.0\server\odoo\models.py", line 2806, in _setup_base self._add_manual_fields(partial) File "E:\ePower\Odoo 10.0\server\odoo\models.py", line 644, in _add_manual_fields field = IrModelFields._instanciate(field_data, partial) File "E:\ePower\Odoo 10.0\server\odoo\addons\base\ir\ir_model.py", line 617, in _instanciate attrs['selection'] = safe_eval(field_data['selection']) File "E:\ePower\Odoo 10.0\server\odoo\tools\safe_eval.py", line 299, in safe_eval c = test_expr(expr, _SAFE_OPCODES, mode=mode) File "E:\ePower\Odoo 10.0\server\odoo\tools\safe_eval.py", line 156, in test_expr code_obj = compile(expr, "", mode)File "<string>", line 0 ^SyntaxError: unexpected EOF while parsing


Help would be greatly appreciated.

Avatar
Discard

There is something wrong with your Code. Pls post it

Best Answer

The error is on xml views. you forget to close one XML tags.  Thays why SyntaxError: unexpected EOF while parsing

Avatar
Discard
Best Answer

SO you have added custom fields and something depends on them, so when you deleted them system got confused and imploded;) Post your code here and in meantime:

- try to restore your backup

-if no backup was made you can also try to update Odoo (follow this tutorial: https://www.odoo.yenthevg.com/update-odoo-environment-github/). This would update Odoo to the latest version and remove all custom fields from the modules as well as dependencies. Then you can play fresh with your custom modules

Avatar
Discard
Best Answer

You can try to comment out the views in the __manifest__.py, then update the module, uncomment the views and update the module again. This is what helps me when I delete fields in my custom module.  

Avatar
Discard
Best Answer


Syntax error be it in XML or Py, upon restarting Odoo Server and/or module upgrade, log will stop at the corrupted file & will give you considerable info

In case of xml syntax: log might hold view file & line number.

In case of py syntax: module loading will be aborted, which will also be available in log



Avatar
Discard