Skip to Content
Menu
This question has been flagged
2815 Views

[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 one2many 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
Avatar
Discard
Related Posts Replies Views Activity
1
Oct 24
175
2
Oct 24
1141
1
Jul 24
453
0
Jun 24
249
2
Feb 24
1122