在Odoo版本8中:"值错误,需要多个值来解包"

时间:2015-08-14 21:29:15

标签: python odoo

我安装了Odoo版本8,我按照Odoo的书来测试一个商业示例。最初,我能够创建新的合作伙伴 - 包括客户和供应商。但是,现在我发现当我第一次安装时,我无法创建新客户/供应商和产品类别。

现在每当我按下客户,合作伙伴和产品类别的“创建新”按钮时,它会向我显示错误"值错误,需要多个值才能解压"

整个错误信息是这个 -

Odoo服务器错误

Traceback (most recent call last):
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 530, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 567, in dispatch
    result = self._call_function(**self.params)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 303, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\service\model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 300, in checked_call
    return self.endpoint(*a, **kw)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 796, in __call__
    return self.method(*args, **kw)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\http.py", line 396, in response_wrap
    response = f(*args, **kw)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\web\controllers\main.py", line 936, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\web\controllers\main.py", line 928, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\api.py", line 336, in old_api
    result = method(recs, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\models.py", line 1317, in default_get
    defaults[name] = self.env['ir.property'].get(name, self._name)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\api.py", line 462, in new_api
    result = method(self._model, cr, uid, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\base\res\ir_property.py", line 157, in get
    return self.get_by_record(cr, uid, record, context=context)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "C:\Bitnami\odoo-8.0-11\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\base\res\ir_property.py", line 138, in get_by_record
    model, resource_id = record.value_reference.split(',')
ValueError: need more than 1 value to unpack

我已经尝试过搜索此问题了。虽然这个问题已经被许多人写过,但在这方面却没有。我真的被困住了,现在不知道该做些什么。

1 个答案:

答案 0 :(得分:2)

我找到了问题。

在文档中,他们说你必须定义属性(定义属性):

property_account_payable        account.account, AP Payable
property_account_receivable     account.account, AC Receivable
property_account_expense_categ  account.account, P Purchase
property_account_income_categ   account.account, S Sales

默认情况下,您会看到属性的格式包含逗号(,)和数字:

property_account_payable        account.account, 12
property_account_receivable     account.account, 32
property_account_expense_categ  account.account, 45
property_account_income_categ   account.account, 23

在指南中,他们要求您删除“,”并将所有内容放在“(”和“)”中。这会在第138行触发代码中的错误(因为它等待逗号):     model,resource_id = record.value_reference.split(',')

只需将属性设置回原来的状态即可。至少,删除“()”和字符。

此致