Odoo 15, RPC_ERROR error message when updating module - odoo-14

I created a custom module, and installed in my Odoo 15 session, after some changes, I tried to update it, but I get the following error message,
How to fix it please?
Thanks,
**RPC_ERROR**
Odoo Server Error
Traceback (most recent call last):
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "C:\Program Files\Odoo15\server\odoo\http.py", line 688, in dispatch
result = self._call_function(**self.params)
File "C:\Program Files\Odoo15\server\odoo\http.py", line 360, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Program Files\Odoo15\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Program Files\Odoo15\server\odoo\http.py", line 349, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Program Files\Odoo15\server\odoo\http.py", line 917, in __call__
return self.method(*args, **kw)
File "C:\Program Files\Odoo15\server\odoo\http.py", line 536, in response_wrap
response = f(*args, **kw)
File "C:\Program Files\Odoo15\server\odoo\addons\web\controllers\main.py", line 1339, in call_button
action = self._call_kw(model, method, args, kwargs)
File "C:\Program Files\Odoo15\server\odoo\addons\web\controllers\main.py", line 1327, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\Program Files\Odoo15\server\odoo\api.py", line 464, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "C:\Program Files\Odoo15\server\odoo\api.py", line 451, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_upgrade
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_module.py", line 662, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_module.py", line 600, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "C:\Program Files\Odoo15\server\odoo\modules\registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "C:\Program Files\Odoo15\server\odoo\modules\loading.py", line 513, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_model.py", line 2269, in _process_end
self._process_end_unlink_record(record)
File "C:\Program Files\Odoo15\server\odoo\addons\website\models\ir_model_data.py", line 36, in _process_end_unlink_record
return super()._process_end_unlink_record(record)
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_model.py", line 2198, in _process_end_unlink_record
record.unlink()
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_model.py", line 1375, in unlink
self._process_ondelete()
File "C:\Program Files\Odoo15\server\odoo\addons\base\models\ir_model.py", line 1423, in _process_ondelete
ondelete = (field.ondelete or {}).get(selection.value)
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files\Odoo15\server\odoo\http.py", line 644, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Program Files\Odoo15\server\odoo\http.py", line 302, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'str' object has no attribute 'get'

You seem to have a selection field with an ondelete parameter as a string which is wrong for selection field ondelete should be a dictionary
example
my_selection = fields.Selection([
('val_1', "Value 1"),
('val_2', "Value 2"),
], ondelete={'val_1': 'set default', 'val_1':'set default'})

Related

odoo plm module problem when create a new revision when i press start newrevision get error

plm module problem  when
create a new revision when i press start newrevision  get error 
Error:Odoo Server ErrorTraceback (most recent call last): File "/odoo/odoo/odoo/api.py", line 1049, in get value = self._data[key][field][record._ids[0]]KeyError: 1245During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/odoo/odoo/odoo/fields.py", line 1065, in get value = record.env.cache.get(record, self) File "/odoo/odoo/odoo/api.py", line 1051, in get raise CacheMiss(record, field)odoo.exceptions.CacheMiss: ('mrp.bom(1245,).is_allowed_to_modif_unit', None)During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/odoo/odoo/odoo/models.py", line 4765, in ensure_one _id, = self._idsValueError: too many values to unpack (expected 1)During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/odoo/odoo/odoo/http.py", line 656, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/odoo/odoo/odoo/http.py", line 314, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise raise value File "/odoo/odoo/odoo/http.py", line 698, in dispatch result = self._call_function(**self.params) File "/odoo/odoo/odoo/http.py", line 346, in _call_function return checked_call(self.db, *args, **kwargs) File "/odoo/odoo/odoo/service/model.py", line 98, in wrapper return f(dbname, *args, **kwargs) File "/odoo/odoo/odoo/http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "/odoo/odoo/odoo/http.py", line 941, in call return self.method(*args, **kw) File "/odoo/odoo/odoo/http.py", line 519, in response_wrap response = f(*args, **kw) File "/odoo/odoo/addons/web/controllers/main.py", line 967, in call_button action = self._call_kw(model, method, args, {}) File "/odoo/odoo/addons/web/controllers/main.py", line 955, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/odoo/odoo/odoo/api.py", line 759, in call_kw return _call_kw_multi(method, model, args, kwargs) File "/odoo/odoo/odoo/api.py", line 746, in _call_kw_multi result = method(recs, *args, **kwargs) File "/odoo/Enterprise/mrp_plm/models/mrp_eco.py", line 586, in action_new_revision 'previous_bom_id': eco.bom_id.id, File "/odoo/odoo/odoo/models.py", line 4336, in copy new = self.with_context(lang=None).create(vals) File "", line 2, in create File "/odoo/odoo/odoo/api.py", line 440, in _model_create_single return create(self, arg) File "/odoo/mycompany/mrp_production_draft/models/mrp_production.py", line 954, in create res = super(MrpBom, self).create(values) File "", line 2, in create File "/odoo/odoo/odoo/api.py", line 461, in _model_create_multi return create(self, [arg]) File "/odoo/odoo/addons/mail/models/mail_thread.py", line 298, in create thread.message_track(tracked_fields, initial_values) File "/odoo/odoo/addons/mail/models/mail_thread.py", line 640, in message_track tracking = self._message_track_get_changes(tracked_fields, initial_values) File "/odoo/odoo/addons/mail/models/mail_thread.py", line 601, in _message_track_get_changes result[record.id] = record._message_track(tracked_fields, initial_values[record.id]) File "/odoo/odoo/addons/mail/models/mail_thread.py", line 618, in _message_track new_value = getattr(self, col_name) File "/odoo/odoo/odoo/fields.py", line 1069, in get self.determine_value(record) File "/odoo/odoo/odoo/fields.py", line 1182, in determine_value self.compute_value(recs) File "/odoo/odoo/odoo/fields.py", line 1136, in compute_value self._compute_value(records) File "/odoo/odoo/odoo/fields.py", line 1127, in _compute_value getattr(records, self.compute)() File "/odoo/mycompany/mrp_production_draft/models/mrp_production.py", line 945, in get_user self.is_allowed_to_modif_unit = True File "/odoo/odoo/odoo/fields.py", line 1084, in set record.ensure_one() File "/odoo/odoo/odoo/models.py", line 4768, in ensure_one raise ValueError("Expected singleton: %s" % self)ValueError: Expected singleton: mrp.bom(1245, 26)
plm module problem  when
create a new revision when i press start newrevision  get error and cannot add role and user empty i cannnot put anything on role

Error while trying to install app on odoo 15

This is the error message I get when I try to install the app
This is the error message I get when I try to install the app
Traceback (most recent call last):
File "/opt/odoo15/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo15/odoo/odoo/http.py", line 687, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo15/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo15/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo15/odoo/odoo/http.py", line 348, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo15/odoo/odoo/http.py", line 916, in __call__
return self.method(*args, **kw)
File "/opt/odoo15/odoo/odoo/http.py", line 535, in response_wrap
response = f(*args, **kw)
File "/opt/odoo15/odoo/addons/web/controllers/main.py", line 1346, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo15/odoo/addons/web/controllers/main.py", line 1334, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo15/odoo/odoo/api.py", line 464, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo15/odoo/odoo/api.py", line 451, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-74>", line 2, in button_immediate_install
File "/opt/odoo15/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo15/odoo/odoo/addons/base/models/ir_module.py", line 486, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo15/odoo/odoo/addons/base/models/ir_module.py", line 603, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo15/odoo/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo15/odoo/odoo/modules/loading.py", line 474, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo15/odoo/odoo/modules/loading.py", line 363, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo15/odoo/odoo/modules/loading.py", line 179, in load_module_graph
load_openerp_module(package.name)
File "/opt/odoo15/odoo/odoo/modules/module.py", line 396, in load_openerp_module
__import__('odoo.addons.' + module_name)
File "/opt/odoo15/odoo/addons/pragtech_whatsapp_base/__init__.py", line 3, in <module>
from . import controller
File "/opt/odoo15/odoo/addons/pragtech_whatsapp_base/controller/__init__.py", line 1, in <module>
from . import main
File "/opt/odoo15/odoo/addons/pragtech_whatsapp_base/controller/main.py", line 5, in <module>
import phonenumbers
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo15/odoo/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo15/odoo/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
ModuleNotFoundError: No module named 'phonenumbers'
I tried to install a terminal app on Odoo and it showed me this error
This is the error message I get when I try to install the app
This is the error message I get when I try to install the app
This is the error message I get when I try to install the app
The module uses phonenumbers to sanitize country mobile.
Installing the phonenumbers should fix that error:
pip install phonenumbers

New model added via Studio causes a KeyError on a computed field

[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

Odoo Error when installing module KeyError

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

Odoo 12 Server Error KeyError: 'crm.Stage'

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'