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

Keyerror/ Odoo crashes after app install. Where is the error?

By
guido
on 2/12/15, 7:26 AM 1,094 views

I try to write my first App and it works as long as i don't restart the server. The window stays blank or i get an internal server error. Log says Key Error: mrp.repair.

Here is my code (shorted already for tracking the issue):

__init__.py

# -*- coding: utf-8 -*-
import controllers
import models
import mrp_repair_update

__openerp__.py

# -*- coding: utf-8 -*-
{
    'name': "mrp_repair_update",

    'summary': """
        Short (1 phrase/line) summary of the module's purpose, used as
        subtitle on modules listing or apps.openerp.com""",

    'description': """
        Long description of module's purpose
    """,

    'author': "G. S.",
    'website': "http://www.yourcompany.com",

    # Categories can be used to filter modules in modules listing
    # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
    # for the full list
    'category': 'Uncategorized',
    'version': '0.1',

    # any module necessary for this one to work correctly
    'depends': ['base'],

    # always loaded
    'data': [
        # 'security/ir.model.access.csv',
        'templates.xml',
        'views/mrp_repair_update_view.xml',
    ],
    # only loaded in demonstration mode
    'demo': [
        'demo.xml',
    ],
}

mrp_repair_update.py

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


from openerp import fields, models


class mrp_repair_update(models.Model):
    _inherit = "mrp.repair"
    Kommission = fields.Char(string="Kommission", required=True)

 

mrp_update_view.xml

<?xml version="1.0" encoding="UTF-8"?>
 <openerp>
    <data>
        <!-- Add instructor field to existing view -->
        <record model="ir.ui.view" id="mrp_repair_update_form">
            <field name="name">mrp_repair.mrp_repair_update</field>
            <field name="model">mrp.repair</field>
            <field name="inherit_id" ref="mrp_repair.view_repair_order_form"/>
            <field name="arch" type="xml">
                <notebook position="inside">
                    <page string="Base">
                        <group>
                            <field name="Kommission"/>
                        </group>
                    </page>
                </notebook>
            </field>
        </record>

    </data>
</openerp>

hey guido, Just add mrp_repair module to dependency module list of __openerp__.py file just like this, 'depends': ['base' , 'mrp_repair']

Mansi Kariya (mka)
on 2/12/15, 7:31 AM
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 2/12/15, 7:31 AM

You change depends and try in __openerp__.py

'depends': ['base','mrp_repair'],

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: 2/12/15, 7:26 AM
Seen: 1094 times
Last updated: 3/16/15, 8:10 AM