Skip to content

[19.0][IMP] crm_stage_probability: prevent installation error on deleted default stages#748

Open
CRogos wants to merge 1 commit into
OCA:19.0from
c4a8-odoo:19.0-imp-crm_stage_probability
Open

[19.0][IMP] crm_stage_probability: prevent installation error on deleted default stages#748
CRogos wants to merge 1 commit into
OCA:19.0from
c4a8-odoo:19.0-imp-crm_stage_probability

Conversation

@CRogos
Copy link
Copy Markdown
Contributor

@CRogos CRogos commented May 28, 2026

When a stage is deleted before this module is installed, you get this error message when trying to install the module. (happens also on upgrade)

Odoo Server Error

RPC_ERROR
Odoo Server Error

Occured on oca-crm-19-0-d02b4b5f2197.runboat.odoo-community.org on model ir.module.module on 2026-05-28 11:36:06 GMT

Traceback (most recent call last):
  File "/opt/odoo/odoo/tools/convert.py", line 605, in _tag_root
    f(rec)
  File "/opt/odoo/odoo/tools/convert.py", line 387, in _tag_record
    raise Exception("Cannot update missing record %r" % xid)
Exception: Cannot update missing record 'crm.stage_lead3'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 2302, in _serve_db
    return service_model.retrying(serve_func, env=self.env)
  File "/opt/odoo/odoo/service/model.py", line 188, in retrying
    result = func()
  File "/opt/odoo/odoo/http.py", line 2357, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/odoo/http.py", line 2572, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 355, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/odoo/http.py", line 811, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/addons/web/controllers/dataset.py", line 38, in call_button
    action = call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/service/model.py", line 97, in call_kw
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 492, in button_immediate_install
    return self._button_immediate_function(self.env.registry[self._name].button_install)
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 633, in _button_immediate_function
    registry = modules.registry.Registry.new(self.env.cr.dbname, update_module=True)
  File "/opt/odoo/odoo/tools/func.py", line 88, in locked
    return func(inst, *args, **kwargs)
  File "/opt/odoo/odoo/orm/registry.py", line 199, in new
    load_modules(
  File "/opt/odoo/odoo/modules/loading.py", line 464, in load_modules
    load_module_graph(
  File "/opt/odoo/odoo/modules/loading.py", line 217, in load_module_graph
    load_data(env, idref, 'init', kind='data', package=package)
  File "/opt/odoo/odoo/modules/loading.py", line 59, in load_data
    convert_file(env, package.name, filename, idref, mode, noupdate=kind == 'demo')
  File "/opt/odoo/odoo/tools/convert.py", line 693, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/opt/odoo/odoo/tools/convert.py", line 792, in convert_xml_import
    obj.parse(doc.getroot())
  File "/opt/odoo/odoo/tools/convert.py", line 663, in parse
    self._tag_root(de)
  File "/opt/odoo/odoo/tools/convert.py", line 618, in _tag_root
    raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /mnt/data/odoo-addons-dir/crm_stage_probability/data/crm_stage.xml:11, somewhere inside
<record model="crm.stage" id="crm.stage_lead3">
        <field name="on_change" eval="True"/>
        <field name="probability">70</field>
    </record>

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
        at makeErrorFromResponse (http://oca-crm-19-0-d02b4b5f2197.runboat.odoo-community.org/web/assets/1d3e515/web.assets_web.min.js:3197:165)
        at XMLHttpRequest.<anonymous> (http://oca-crm-19-0-d02b4b5f2197.runboat.odoo-community.org/web/assets/1d3e515/web.assets_web.min.js:3204:13)

@OCA-git-bot OCA-git-bot added series:19.0 mod:crm_stage_probability Module crm_stage_probability labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:crm_stage_probability Module crm_stage_probability series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants