Why does my simple odoo extension crash my server on upgrade?

98 views Asked by At

I am currently in the process of learning odoo. For this, I attempted to create a small extension module that adds a few fields to the product module. From the material I have, this is what my respective model looks like:

# -*- coding: utf-8 -*-

from odoo import fields, models

class product(models.Model):
    _inherit = 'product.product'
    testBool = fields.Boolean('This is a test', default=False)
    ean = fields.Char('EAN')

and this is the respective view:

<?xml version="1.0" encoding="UTF-8"?>

<odoo>
    <record id="product_testbool_form_view" model="ir.ui.view">
        <field name="name">product.template.common.form.testbool</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_form_view" />
        <field name="arch" type="xml">
            <form position="inside">
                <sheet position="inside">
                    <div class="oe_title" position="inside">
                        <field name="purchase_ok" position="after">
                            <div>
                                <field name="testBool"/>
                                <label for="testBool"/>
                            </div>
                        </field>
                    </div>
                </sheet>
            </form>
        </field>

    </record>


    <record model="ir.ui.view" id="product_ean_form_view">
        <field name="name">product.ean</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view" />
        <field name="arch" type="xml">
                <field name="barcode" position="after">
                    <field name="ean"/>
                </field>
        </field>

    </record>
</odoo>

(Obviously the respective init.py and manifest.py files got the needed imports.) Now, while this installs without errors, it also doesn't work (no additional fields are shown in the product view), so there's definitely something I'm doing wrong here (although I don't know what, because I'm following the tutorials, but oh well).

However, the real problem happens when I stop and then restart the odoo service to see if this changes anything: The server won't start back up and the log contains the following (pastebin for length):

Pastebin error log

Can anyone help me figure out what's going wrong here? I'm fairly certain it's something trivial that I'm getting wrong that the tutorials and odoo development cookbooks don't mention (they seem to be rather spotty anyway). But I've been trying to solve this for days now and I'm at a loss.

0

There are 0 answers