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

Odoo does not start, stuck on previous bad XML syntax / Too many redirects

By
E.M.
on 11/5/15, 12:23 PM 977 views

I am writting a new module which includes views customization through XML.

While writting the XML, it seems that I have referenced a non-existing field in XML, but now I can not start odoo again, even when I change the XML file.

Is it possible to fully deinstall the module from command line? Is it possible to stuck the server becuase of a bad module?

Error context:
View `sale.margin.percent.view.form`
[view_id: 797, xml_id: sale_margin_percent.sale_margin_percent_u5, model: sale.order, parent_id: 794]
2015-11-05 17:25:54,320 661 INFO test1 werkzeug: 127.0.0.1 - - [05/Nov/2015 17:25:54] "GET /web?db=test1 HTTP/1.1" 302 -
2015-11-05 17:25:54,628 661 INFO test1 openerp.modules.loading: loading 1 modules...
2015-11-05 17:25:54,644 661 INFO test1 openerp.modules.loading: 1 modules loaded in 0.02s, 0 queries
2015-11-05 17:25:54,725 661 INFO test1 openerp.modules.loading: loading 63 modules...
2015-11-05 17:25:56,598 661 INFO test1 openerp.modules.module: module sale_margin_percent: creating or updating database tables
2015-11-05 17:25:56,683 661 INFO test1 openerp.modules.loading: loading sale_margin_percent/sale_margin_percent.xml
2015-11-05 17:25:57,011 661 ERROR test1 openerp.addons.base.ir.ir_ui_view: Element '<xpath expr="//field[@name='order_line']/tree/field[@name='purchase_price']">' cannot be located in parent view

Error context:
View `sale.margin.percent.view.form`
[view_id: 797, xml_id: sale_margin_percent.sale_margin_percent_u5, model: sale.order, parent_id: 794]
2015-11-05 17:25:57,014 661 INFO test1 werkzeug: 127.0.0.1 - - [05/Nov/2015 17:25:57] "GET /web?db=test1 HTTP/1.1" 302 -
2015-11-05 17:25:57,489 661 INFO test1 openerp.modules.loading: loading 1 modules...
2015-11-05 17:25:57,507 661 INFO test1 openerp.modules.loading: 1 modules loaded in 0.02s, 0 queries
2015-11-05 17:25:57,593 661 INFO test1 openerp.modules.loading: loading 63 modules...
2015-11-05 17:25:59,681 661 INFO test1 openerp.modules.module: module sale_margin_percent: creating or updating database tables
2015-11-05 17:25:59,764 661 INFO test1 openerp.modules.loading: loading sale_margin_percent/sale_margin_percent.xml
2015-11-05 17:26:00,105 661 ERROR test1 openerp.addons.base.ir.ir_ui_view: Element '<xpath expr="//field[@name='order_line']/tree/field[@name='purchase_price']">' cannot be located in parent view

 The XML no longer has that part of code caussing the issue. The problem is that at the end I get "Too many redirects" in Chrome and I can no longer access the application.

2
Shawn Varghese
On 11/6/15, 5:36 AM

After making the change, did you try updating the module via command line:

./openerp-server -u <your_module_name> -d test1

This should probably work.

If not, you can also try querying the module list table:

select state from ir_module_module where name='module_name';

The state will probably be 'installed'

You could try setting it to 'uninstalled':

update ir_module_module set state='uninstalled' where name='module_name';

Then try restarting the server.i

This should only be done on a Dev server - it is more a hack than a solution. Just updating the module through command line should work.

 


1
Rubén Cabrera
On 11/6/15, 6:01 AM

If none of the options from Shawn Varghese work, try stopping the server and commenting out in the __openerp__.py file the view causing the problem:

"data": [

"views/name_of_view_raising_errors.xml"

],


Then start the server again, fix the code and upgrade the module when you are done.  


Oh yea, you're right ! I missed this out.... this should probably be the first thing to try

Shawn Varghese
on 11/6/15, 12:07 PM
0
E.M.
On 11/8/15, 8:34 AM

Thanks both of you. I finally managed to startup the server by modifying the code but keeping the modification chunks previously defined (instead of removing them up). It seems that once certain code is in place, you can only modify in a way where the previous change is updated. Weird behaviour.

I keep your solutions for future as I guess this will happen from time to time.

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: 11/5/15, 12:23 PM
Seen: 977 times
Last updated: 11/8/15, 8:34 AM