after uninstalling some modules a strange error appears whenever I try to install modules and i can't install any of them.
Odoo official modules are affected too.
Can't figure out what could the problem be.
Here is the traceback:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 648, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 685, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 321, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 314, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 964, in __call__
return self.method(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 514, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 892, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 880, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 459, in button_immediate_install
return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 534, in _button_immediate_function
registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 338, in load_modules
loaded_modules, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 137, in load_module_graph
init_module_models(cr, package.name, models)
File "/usr/lib/python2.7/dist-packages/openerp/modules/module.py", line 300, in init_module_models
result = obj._auto_init(cr, {'module': module_name})
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 2643, in _auto_init
self._set_default_value_on_column(cr, k, context=context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 2399, in _set_default_value_on_column
default = default(self, cr, SUPERUSER_ID, context)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 354, in old_api
result = method(recs, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 82, in <lambda>
return api.model(lambda model: field.convert_to_write(value(model)))
File "/usr/lib/python2.7/dist-packages/openerp/fields.py", line 1718, in convert_to_write
return value.id
AttributeError: 'int' object has no attribute 'id'
EDIT: I've installed pip and upgraded all the packages, the error disappeared and now i've got a new one:
2016-11-23 18:24:23,868 820 WARNING myerp openerp.models.schema: Table 'product_category': unable to set a NOT NULL constraint on column 'name' !
If you want to have it, you should update the records and execute manually:
ALTER TABLE product_category ALTER COLUMN name SET NOT NULL
2016-11-23 18:24:24,468 820 INFO myerp openerp.sql_db: bad query: ALTER TABLE "product_product" ADD FOREIGN KEY ("product_tmpl_id") REFERENCES "product_template" ON DELETE cascade
2016-11-23 18:24:24,468 820 ERROR myerp openerp.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 338, in load_modules
loaded_modules, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 137, in load_module_graph
init_module_models(cr, package.name, models)
File "/usr/lib/python2.7/dist-packages/openerp/modules/module.py", line 307, in init_module_models
obj._auto_end(cr, {'module': module_name})
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 2716, in _auto_end
cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 141, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 220, in execute
res = self._obj.execute(query, params)
IntegrityError: insert or update on table "product_product" violates foreign key constraint "product_product_product_tmpl_id_fkey"
DETAIL: Key (product_tmpl_id)=(1) is not present in table "product_template".
What could i do?
Related
[Odoo v13 cloud edition]
I've added a new model via Studio: crm.lead.activities. In that model I have a computed field x_name:
Dependencies: x_res_id, x_date, x_activity_type_id
Compute:
for record in self:
record['x_name'] = record.x_res_id.name + ' / ' + str(record.x_date) + ' / ' + record.x_activity_type_id.name
x_res_id is a many2one field to crm.lead
But when I try to (un)install a module, I get a KeyError. What can I do to solve this?
Odoo Server Error
Traceback (most recent call last):
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/odoo/src/odoo/13.0/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo/src/odoo/13.0/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/home/odoo/src/odoo/13.0/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/home/odoo/src/odoo/13.0/addons/web/controllers/main.py", line 1326, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/home/odoo/src/odoo/13.0/addons/web/controllers/main.py", line 1314, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo/src/odoo/13.0/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/odoo/src/odoo/13.0/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-66>", line 2, in button_immediate_upgrade
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_module.py", line 634, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/home/odoo/src/custom/trial/saas_trial/models/module.py", line 99, in _button_immediate_function
res = super(IrModuleModule, self)._button_immediate_function(function)
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoo/src/odoo/13.0/odoo/modules/loading.py", line 369, in load_modules
registry.setup_models(cr)
File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 290, in setup_models
for path in transitive_dependencies(field):
File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 276, in transitive_dependencies
for seq2 in transitive_dependencies(seq1[-1], seen + [field]):
File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 272, in transitive_dependencies
for seq1 in dependencies[field]:
KeyError: x_crm.lead.activities.x_name
I am getting the following error when installing a module, I could use some help. How can I fix it?
I am working with odoo v12
Odoo Server Error
Traceback (most recent call last):
File "/home/ernesto/odoo12/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/ernesto/odoo12/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/ernesto/odoo12/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/ernesto/odoo12/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/home/ernesto/odoo12/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/ernesto/odoo12/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/home/ernesto/odoo12/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/ernesto/odoo12/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/home/ernesto/odoo12/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/ernesto/odoo12/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/home/ernesto/odoo12/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/ernesto/odoo12/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/home/ernesto/odoo12/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-61>", line 2, in button_immediate_install
File "/home/ernesto/odoo12/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/home/ernesto/odoo12/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/home/ernesto/odoo12/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/ernesto/odoo12/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/ernesto/odoo12/odoo/modules/loading.py", line 421, in load_modules
loaded_modules, update_module, models_to_check)
File "/home/ernesto/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/ernesto/odoo12/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/home/ernesto/odoo12/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/home/ernesto/odoo12/odoo/tools/convert.py", line 798, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "/home/ernesto/odoo12/odoo/tools/convert.py", line 841, in convert_csv_import
result = env[model].load(fields, datas)
File "/home/ernesto/odoo12/odoo/models.py", line 943, in load
for id, xid, record, info in converted:
File "/home/ernesto/odoo12/odoo/models.py", line 1068, in _convert_records
for record, extras in stream:
File "/home/ernesto/odoo12/odoo/tools/misc.py", line 859, in next
val = next(self.stream, _ph)
File "/home/ernesto/odoo12/odoo/models.py", line 991, in _extract_records
for index, fnames in enumerate(fields_)
File "/home/ernesto/odoo12/odoo/models.py", line 992, in <listcomp>
if fields[fnames[0]].type == 'one2many'
KeyError: 'id
I am getting the following error when installing a module, I could use some help. How can I fix it?
I am working with odoo v12
The error occurs when Odoo tries to import a CSV file.
Check the CSV files listed in the data section of the manifest file.
Maybe there is an apostrophe or blank spaces just before the id field name. You can reproduce a similar error using the following CSV file:
'id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_product_product_account_user,product.product.account.user,product.model_product_product,group_account_user,1,0,0,0
I am a starter in odoo. Can anyone help me to find a solution for the problem mentioned below?
In CRM Module I'm getting this below this error when I save any record in CRM Module, it was working fine for a while but idk after sometime when I create or change any record this error pops up
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo-12.0/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-12.0/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo-12.0/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo/odoo-12.0/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-12.0/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-12.0/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-12.0/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo-12.0/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo-12.0/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo-12.0/addons/web/controllers/main.py", line 962, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo-12.0/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo-12.0/odoo/api.py", line 757, in call_kw
return _call_kw_model_create(method, model, args, kwargs)
File "/opt/odoo/odoo-12.0/odoo/api.py", line 737, in _call_kw_model_create
result = method(recs, *args, **kwargs)
File "<decorator-gen-260>", line 2, in create
File "/opt/odoo/odoo-12.0/odoo/api.py", line 461, in _model_create_multi
return create(self, [arg])
File "/opt/odoo/odoo-12.0/addons/base_automation/models/base_automation.py", line 228, in create
records = create.origin(self.with_env(actions.env), vals_list, **kw)
File "<decorator-gen-116>", line 2, in create
File "/opt/odoo/odoo-12.0/odoo/api.py", line 462, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo-12.0/addons/mail/models/mail_thread.py", line 272, in create
threads = super(MailThread, self).create(vals_list)
File "<decorator-gen-3>", line 2, in create
File "/opt/odoo/odoo-12.0/odoo/api.py", line 462, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo-12.0/odoo/models.py", line 3534, in create
vals = self._add_missing_default_values(vals)
File "/opt/odoo/odoo-12.0/odoo/models.py", line 1700, in _add_missing_default_values
defaults = self.default_get(list(missing_defaults))
File "/opt/odoo/odoo-12.0/odoo/models.py", line 1168, in default_get
defaults[name] = field.default(self)
File "/opt/odoo/odoo-12.0/crm_internal_new/crm_extended/models/crm_lead_extended.py", line 37, in get_default_won_id1
return self.env['crm.Stage'].search([('name', '=', 'Won')]).id
File "/opt/odoo/odoo-12.0/odoo/api.py", line 831, in __getitem__
return self.registry[model_name]._browse((), self)
File "/opt/odoo/odoo-12.0/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'crm.Stage'
I am using Odoo 8 on Ubuntu.
I have problem opening some customers (some are OK). When I try to open it for editing I get Odoo Server Error...IndexError: list index out of range.
Any idea what could cause this problem ? I tried to search for similar problems but I have not found any solution. So when I want to edit the client I have to create new one, I also tried to merge them after creating new one but the error reappears again.
thank you and here is complete traceback:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 300, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 796, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 396, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 949, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 932, in _call_kw
records = getattr(request.session.model(model), method)(*args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 900, in proxy
result = meth(cr, request.uid, *args, **kw)
File "/opt/odoo/odoo/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3109, in read
result = BaseModel.read(records, fields, load=load)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3305, in _read_from_database
res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result)
File "/opt/odoo/odoo/openerp/osv/fields.py", line 1361, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/odoo/odoo/addons/account/partner.py", line 246, in _invoice_total
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
File "/opt/odoo/odoo/addons/account/partner.py", line 246, in <genexpr>
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
File "/opt/odoo/odoo/openerp/fields.py", line 760, in __get__
self.determine_value(record)
File "/opt/odoo/odoo/openerp/fields.py", line 853, in determine_value
record._prefetch_field(self)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3196, in _prefetch_field
result = records.read(list(fnames), load='_classic_write')
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3292, in _read_from_database
res2 = self._columns[fs[0]].get(cr, self._model, ids, fs, user, context=context, values=result)
File "/opt/odoo/odoo/openerp/osv/fields.py", line 1361, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/odoo/odoo/addons/account/report/account_invoice_report.py", line 40, in _compute_amounts_in_user_currency
currency_rate_id = currency_rate_obj.search(cr, uid, [('rate', '=', 1)], limit=1, context=context)[0]
IndexError: list index out of range
in the searching of currency_rate_id, the search function is getting an empty list and you are trying to select the first element from the empty list which causes the error
The solution is to add an exchange rate for the currency.
1 - Settings->Companies
2 - Edit your commpany
3 - Modify the Currency update configuration
4 - Add values for "Currencies to update" tab
Image 1
Image 2
Image 3
Our Odoo is version 8 and is running on Ubuntu.
When I try to open product which has multiple attributes (colours, sizes) I get KeyError: 57. Other simple products are OK.
Any idea what can cause this problem ?
here is complete traceback:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 300, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 796, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 396, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 949, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 932, in _call_kw
records = getattr(request.session.model(model), method)(*args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 900, in proxy
result = meth(cr, request.uid, *args, **kw)
File "/opt/odoo/odoo/openerp/api.py", line 241, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3109, in read
result = BaseModel.read(records, fields, load=load)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3305, in _read_from_database
res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result)
File "/opt/odoo/odoo/openerp/osv/fields.py", line 1361, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/opt/odoo/odoo/addons/sale/sale.py", line 1283, in _sales_count
res[template.id] = sum([p.sales_count for p in template.product_variant_ids])
File "/opt/odoo/odoo/openerp/fields.py", line 760, in __get__
self.determine_value(record)
File "/opt/odoo/odoo/openerp/fields.py", line 853, in determine_value
record._prefetch_field(self)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3196, in _prefetch_field
result = records.read(list(fnames), load='_classic_write')
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3141, in read
self._read_from_database(stored)
File "/opt/odoo/odoo/openerp/api.py", line 239, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3308, in _read_from_database
vals[f] = res2[vals['id']]
KeyError: 57
I got same error like your log, but I don't know your code details. You should check field type.
In my case, I used field function.
I was make mistaken like below:
rec = obj.browse(cr,...)
result = {}
# result[id] = val # wrong
result[rec.id] = val # correct
I hope this helps..