卸载Odoo模块会导致无法解释的错误

时间:2016-05-11 18:09:43

标签: python-2.7 module openerp odoo-9

我无法让一个简单的模块在Odoo 9中正常工作。这就是;它工作正常,但当我卸载时,我收到以下错误(请参阅下面的源代码)。

__初始化__。PY

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

from . import models

OpenERP的的.py

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

    'summary': """Chamber of Commerce Identifier""",

    'description': """
        Adds Chamber of Commerce Identifier field to partners
    """,

    'author': "Author",
    'website': "http://www.whatever.nl",

    'category': 'Accounting',
    'version': '1.0',

    'depends': [
        'base',
        'product'
    ],

    'data': [
        'views/partner_views.xml',
    ],
}

模型/ partner.py

# -*- coding: utf-8 -*-
from openerp import fields, models

class Partner(models.Model):
    _inherit = 'res.partner'

    cid = fields.Char("CoC", help="Chamber of Commerce ID")

视图/ partner_views.xml

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

            <!--
            Partners Extension
            -->

            <record model="ir.ui.view" id="">
                <field name="name">res.partner.property.form.inherit</field>
                <field name="model">res.partner</field>
                <field name="inherit_id" ref="base.view_partner_form"/>
                <field name="arch" type="xml">
                    <field name="website" position="before">
                        <field name="cid" placeholder="Chamber of Commerce ID"/>
                    </field>
                </field>
            </record>
        </data>
    </openerp>

有谁知道为什么会这样?

Odoo Server Error
Traceback (most recent call last):
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 680, in dispatch
    result = self._call_function(**self.params)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/addons/web/controllers/main.py", line 896, in call_button
    action = self._call_kw(model, method, args, {})
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/addons/web/controllers/main.py", line 884, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/addons/base/module/wizard/base_module_upgrade.py", line 87, in upgrade_module
    openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/modules/registry.py", line 389, in new
    del cls.registries[db_name]
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/tools/func.py", line 60, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/xxxxx/odoo9-env/odoo-9.0c-20160511/openerp/tools/lru.py", line 72, in __delitem__
    nobj = self.d[obj]
KeyError: u'001_dev'

001_dev是数据库名称。

0 个答案:

没有答案