I have state filed which is a Selection field. I want to group the records based on this state field in kanban view.
here is my code:
*.py
state = fields.Selection([('draft','Draft'),('process','Processing')
,('intransit','In-transit'),('done','Delivered'),('cancel','Canceled')],
default="draft",string="Status", track_visibility="onchange",
group_expand='_expand_states',index=True)
#api.model
def _expand_states(self, states, domain, order):
return [key for key, val in type(self).state.selection]
But i am getting this error:
> Traceback (most recent call last):
File "/home/user/Projects/odoo-10/odoo/http.py", line 642, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/user/Projects/odoo-10/odoo/http.py", line 684, in dispatch
result = self._call_function(**self.params)
File "/home/user/Projects/odoo-10/odoo/http.py", line 334, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/user/Projects/odoo-10/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/home/user/Projects/odoo-10/odoo/http.py", line 327, in checked_call
result = self.endpoint(*a, **kw)
File "/home/user/Projects/odoo-10/odoo/http.py", line 942, in __call__
return self.method(*args, **kw)
File "/home/user/Projects/odoo-10/odoo/http.py", line 507, in response_wrap
response = f(*args, **kw)
File "/home/user/Projects/odoo-10/odoo/addons/web/controllers/main.py", line 895, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/user/Projects/odoo-10/odoo/addons/web/controllers/main.py", line 887, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/user/Projects/odoo-10/odoo/api.py", line 687, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/home/user/Projects/odoo-10/odoo/api.py", line 672, in call_kw_model
result = method(recs, *args, **kwargs)
File "/home/user/Projects/odoo-10/odoo/models.py", line 1939, in read_group
result = self._read_group_raw(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
File "/home/user/Projects/odoo-10/odoo/models.py", line 2052, in _read_group_raw
aggregated_fields, count_field, result, read_group_order=order,
File "/home/user/Projects/odoo-10/odoo/models.py", line 1680, in _read_group_fill_results
groups = self.env[field.comodel_name].browse(group_ids)
File "/home/user/Projects/odoo-10/odoo/api.py", line 760, in __getitem__
return self.registry[model_name]._browse((), self)
File "/home/user/Projects/odoo-10/odoo/modules/registry.py", line 177, in __getitem__
return self.models[model_name]
KeyError: None
How can i solve this?
Have you put default_group_by="state" in xml file where kanban tag is placed as an attribute.
Remove the group_expand method and remove attribute from field, because it's a selection field so you don't need to return ids, just place the attribute default_group_by="state" in xml file and you'll see the result.
According to source code documentation, the method defined in group_expand should return a list of all aggregated values that we want to display for this field, in the form of a m2o-like pair (key,label).
The _read_group_fill_results method will always try to get the comodel_name of the field to build groups and because the comodel_name is not defined for selection fields, Odoo will raise a KeyError: None.
Unfortunately, returning a list of values that will be used as groups is available since Odoo-11.
Related
I get this error when I try to upgrade my custom module in odoo 13.
Odoo Server Error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 619, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 309, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/odoo/odoo-server/odoo/http.py", line 664, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 345, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 93, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 338, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 910, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 510, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1324, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1312, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-64>", line 2, in button_immediate_upgrade
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 629, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 471, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1971, in _process_end
record.unlink()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1190, in unlink
table=self.env[selection.field_id.model]._table,
File "/opt/odoo/odoo13/odoo/api.py", line 463, in __getitem__
return self.registry[model_name]._browse(self, (), ())
File "/opt/odoo/odoo13/odoo/modules/registry.py", line 177, in __getitem__
return self.models[model_name]
KeyError: 'sales.terms'
This is the sales.terms model
class SalesTermsAndConditions(models.Model):
_name = 'sales.terms'
_description = 'Terms and Conditions'
_rec_name = 'typex'
new_type = fields.Selection([
('accessories', 'Accessories'),
('glass', 'Glass Work'),
('aluminium', 'Aluminium profiles'),
('projects', 'Projects')
], string='Testing')
d_active = fields.Boolean(string='Active')
notes = fields.Text()
I have a new model named 'sales.terms' I created and I created the corresponding ir.model.access.csv file for it, so I traced down the error and discovered that it isn't the whole model giving causing the error but just the selection field, if i remove the selection field the module upgrades fine.
I am confused as to what might be wrong.
I think there is something missing
class SalesTermsAndConditions(models.Model):
_name = 'sales.terms'
_description = 'Terms and Conditions'
_rec_name = 'typex'
new_type = fields.Selection([
('test', 'Test'),
('atest', 'A test'), // Comma is missing
('accessories', 'Accessories'),
('glass', 'Glass Work'),
('aluminium', 'Aluminium profiles'),
('projects', 'Projects')
], string='Testing')
d_active = fields.Boolean(string='Active')
notes = fields.Text()
Try to remove _rec_name.Replace with some field.
_rec_name = "new_type"
The selection seem to be ok. if you rename new_type does it then upgrade?
Can you look first errors wen you boot odoo or reload modules
while I am trying to update value that affect computed field I got this error:
Odoo Server Error
Traceback (most recent call last):
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 647, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 684, in dispatch
result = self._call_function(**self.params)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 320, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 313, in checked_call
result = self.endpoint(*a, **kw)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 963, in call
return self.method(*args, **kw)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/http.py", line 513, in response_wrap
response = f(*args, **kw)
File "/Users/abdalla/projects/greenway/odoo-server/addons/web/controllers/main.py", line 904, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/addons/web/controllers/main.py", line 896, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/api.py", line 381, in old_api
result = method(recs, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/models.py", line 6036, in onchange
record.mapped(field_seq)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/models.py", line 5534, in mapped
recs = recs._mapped_func(operator.itemgetter(name))
File "/Users/abdalla/projects/greenway/odoo-server/openerp/models.py", line 5514, in _mapped_func
vals = [func(rec) for rec in self]
File "/Users/abdalla/projects/greenway/odoo-server/openerp/models.py", line 5752, in getitem
return self._fields[key].get(self, type(self))
File "/Users/abdalla/projects/greenway/odoo-server/openerp/fields.py", line 829, in get
self.determine_value(record)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/fields.py", line 927, in determine_value
record._prefetch_field(self)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/Users/abdalla/projects/greenway/odoo-server/openerp/models.py", line 3295, in _prefetch_field
assert self in records and field in fs
AssertionError
finally I found the problem:
the problem is that the method of the computed field is not exist (I renamed it accidentally). so when odoo try to get the value of this field it failed, and show this strange error
consider this method:
#api.multi
def new_open_window(list_ids, xml_id, module):
""" Generate new window at view form or tree """
action = self.env.ref("{}.{}".format(module, xml_id))
result = action.read()[0]
if isinstance(list_ids, (list, tuple)):
result['domain'] = [('id', 'in', list_ids)]
else:
result['res_id'] = list_ids
return result
This method is called by this one:
#api.multi
def create_invoice(self):
""" Create a invoice refund
"""
#context = context or {}
wizard_brw = self.browse()
inv_id = self._context.get('active_id')
for wizard in wizard_brw:
if not wizard.sure:
raise UserError(
_("Validation error!"),
_("Please confirm that you know what you're doing by"
" checking the option bellow!"))
if (wizard.invoice_id and wizard.invoice_id.company_id.jour_id and
wizard.invoice_id and wizard.invoice_id.company_id.acc_id):
inv_id = self.action_invoice_create(wizard,
wizard.invoice_id)
else:
raise UserError(
_('Validation error!'),
_("You must go to the company form and configure a journal"
" and an account for damaged invoices"))
return self.new_open_window([inv_id], 'action_invoice_tree1', 'account')
On clicking create_invoice button/method it throws me this:
Traceback (most recent call last):
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 675, in dispatch
result = self._call_function(**self.params)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 331, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/service/model.py", line 119, in wrapper
return f(dbname, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 324, in checked_call
result = self.endpoint(*a, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 933, in __call__
return self.method(*args, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 866, in call_button
action = self._call_kw(model, method, args, {})
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 854, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 681, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 672, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/kristian/odoov10/gilda/l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py", line 138, in create_invoice
return self.new_open_window(inv_id, 'action_invoice_tree1', 'account')
TypeError: new_open_window() takes exactly 3 arguments (4 given)
SO, since this uses #api.multi and it's a method which is called from a button, I don't know if part of the problem is the lack of self.ensure_one(), but I guess it's not, or not only that at least.
Any ideas?
Replace :
def new_open_window(list_ids, xml_id, module):
by :
def new_open_window(self, list_ids, xml_id, module):
I'm migrating some modules from v7 to v10 of Odoo community version.
Right now, I've modified this method, it looks like this:
class ResPartner(models.Model):
_inherit = 'res.partner'
#api.multi
#api.depends('company_id')
def _get_country_code(self):
"""
Return the country code of the user company. If not exists, return XX.
"""
context = dict(self._context or {})
user_company = self.env['res.users'].browse(company_id)
return user_company.partner_id and user_company.partner_id.country_id \
and user_company.partner_id.country_id.code or 'XX'
But every time I try to go to a res.partner view, it throws me this error:
Odoo Server Error
Traceback (most recent call last):
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 675, in dispatch
result = self._call_function(**self.params)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 331, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/service/model.py", line 119, in wrapper
return f(dbname, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 324, in checked_call
result = self.endpoint(*a, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 933, in __call__
return self.method(*args, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 862, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 854, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 681, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 672, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/models.py", line 2995, in read
values[name] = field.convert_to_read(record[name], record, use_name_get)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/models.py", line 5171, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/fields.py", line 860, in __get__
self.determine_value(record)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/fields.py", line 969, in determine_value
self.compute_value(recs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/fields.py", line 924, in compute_value
self._compute_value(records)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/fields.py", line 918, in _compute_value
self.compute(records)
File "/home/kristian/odoov10/gilda/l10n_ve_fiscal_requirements/model/partner.py", line 72, in _get_uid_country
res = {}.fromkeys(self._get_country_code())
File "/home/kristian/odoov10/gilda/l10n_ve_fiscal_requirements/model/partner.py", line 51, in _get_country_code
user_company = self.env['res.users'].browse(company_id)
NameError: global name 'company_id' is not defined
I'm new into v10 API
Any ideas?
It's give you following error:
ValueError: Expected singleton: res.partner(1, 33, 8, 18, 22, 23)'
I think, you have added field in list/tree view. As per your current code, you didn't iterate record-sets.
If you want to keep your original code with improvements self.company_id then we should remove field from list/tree view. Other then you can move forward with my answer. It will work fine.
Try with following code:
#api.depends('company_id')
def _get_country_code(self):
"""
Return the country code of the user company. If not exists, return XX.
"""
context = dict(self._context or {})
for partner in self:
user_company = self.env['res.company'].browse(self.company_id)
#NOTE: replace code name with your real field name where you want to see value
partner.code = user_company.partner_id and user_company.partner_id.country_id \
and user_company.partner_id.country_id.code or 'XX'
You need to access company_id as a member
user_company = self.env['res.users'].browse(self.company_id)
#NeoVe,
but now it says 'raise ValueError("Expected singleton: %s" % self) ValueError: Expected singleton: res.partner(1, 33, 8, 18, 22, 23)' :/ Do You know why please?
you can try adding #api.one or #api.model decorator instead of #api.multi for the function declaration.
I installed Odoo version 8, I was going as per the Odoo book to test a business example on it. Initially I was able to create new partners - both customers and suppliers. But, now I find that I am unable to create new customers/ suppliers and product categories, which i was able to do, when I first installed it.
Now whenever I press the create new button for customers, partners and product categories, it shows me the error "Value error, needs more than one value to unpack"
The whole error message is this -
Odoo Server Error
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
I have already tried searching about this problem. While this problem has been written by many, but not in this context. I am really stuck and do not know what to do now regarding this.
I have found the problem.
In the documentation, they say that you have to define the property (Defining Properties):
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
By default, you will see that the properties have a format containing a comma (,), and a number:
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
In the guide they ask you to remove the "," and to put everything inside "(" and ")". This triggered the error in their code (because it wait a comma) in line 138:
model, resource_id = record.value_reference.split(',')
Just set the properties back to what it was. At least, remove the "()" and the characters.
Regards,