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.

2

How can I recover from 500 Internal Server Error after model changes

By
Trevor Nemanic
on 12/23/15, 8:23 PM 1,345 views

My Odoo version 9 instance now returns a "500 Internal Server Error" after I changed the name of a model and an attribute inside. They both have since been renamed and old tables dropped from the database. I've also cleared all tuples in the current table, and restarted the server, but no success. My code follows the guide on "Building a Website" from Odoo.  The code I originally changed was class Teachers to Customers and attribute fix_tribe.teachers to fix_tribe.customers. My current code is below:

from models.py

class Teachers(models.Model):
_name = 'fix_tribe.teachers'
name = fields.Char()
biography = fields.Html()
course_ids = fields.One2many('fix_tribe.courses', 'teacher_id', string="Courses")

from views.xml

  <record id="action_fix_tribe_customers" model="ir.actions.act_window">
<field name="name">Customers</field>
<field name="res_model">fix_tribe.teachers</field>
</record>

  <record id="fix_tribe_teacher_form" model="ir.ui.view">

<field name="name">FixTribe teachers: form</field>

<field name="model">fix_tribe.teachers</field>

<field name="arch" type="xml">

<form>

<sheet>

<label for="name"/> <field name="name"/>

<label for="biography"/>

<field name="biography"/>

<field name="course_ids">

<tree string="Courses" editable="bottom">

<field name="name"/>

</tree>

</field>

</sheet>

</form>

</field>

</record>

0
Trevor Nemanic
On 12/24/15, 12:20 PM

I went into the log file /server/openerp-server.log and it showed that my __openerp__.py file was attempting to reference a data file that does not exist. Removing this reference solved the error. 

Happy Odoo's answer did in fact cause the server to start, but not solve the problem.

Dr Obx's answer only would work for Linux and I am running Windows

4
HappyOdoo
On 12/24/15, 2:29 AM

Trevor Nemanic

If your code is in New Module then Remove that Module folder form addons directory and restart the ERP.

it will work. 500 Internal Error will Remove.

if ERP started then you have to check this custom code.


1
Dr Obx
On 12/24/15, 5:19 AM

I strongly recommend to run Odoo server from the console if You testing a new code. If there is any problem it will tell you what cause it.
To do it:

1. Open Terminal
2. type 'service odoo stop'
3. as a root type: sudo su - odoo -s /bin/bash
4. run 'openerp-server'
then watch the console against the errors.

You can see there all messages generated by openerp-server also if there is any problem you can copy and paste it in your posts, it can be very helpful  :)

 

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: 12/23/15, 8:23 PM
Seen: 1345 times
Last updated: 12/24/15, 12:20 PM