OCA / l10n-france

France Localization for Odoo
GNU Affero General Public License v3.0
42 stars 118 forks source link

[16] impossible to install/update l10n_fr_mis_reports in 16.0.1.0.1 #569

Open MatSarr opened 1 month ago

MatSarr commented 1 month ago

Module

l10n_fr_mis_report

Describe the bug

when trying to update or install the module, there is the following error:

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 698, in _tag_root
    f(rec)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 599, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4393, in _load_records
    data['record']._load_records_write(data['values'])
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4324, in _load_records_write
    self.write(values)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3816, in write
    fields[0].determine_inverse(real_recs)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1401, in determine_inverse
    determine(self.inverse, records)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 98, in determine
    return needle(*args)
  File "/opt/odoo/auto/addons/mis_builder/models/mis_report.py", line 193, in _inverse_expression
    expression.unlink()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3605, in unlink
    cr.execute(query, (sub_ids,))
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 321, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: update or delete on table "mis_report_kpi_expression" violates foreign key constraint "mis_budget_item_kpi_expression_id_fkey" on table "mis_budget_item"
DETAIL:  Key (id)=(194) is still referenced from table "mis_budget_item".

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

Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1697, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1724, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1928, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/opt/odoo/auto/addons/website/models/ir_http.py", line 237, in _dispatch
    response = super()._dispatch(endpoint)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 780, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/opt/odoo/auto/addons/web/controllers/dataset.py", line 46, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/auto/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-77>", line 2, in button_immediate_install
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py", line 475, in button_immediate_install
    return self._button_immediate_function(self.env.registry[self._name].button_install)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py", line 599, in _button_immediate_function
    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "<decorator-gen-16>", line 2, in new
  File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 91, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 488, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 372, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 231, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 71, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 763, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 829, in convert_xml_import
    obj.parse(doc.getroot())
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 749, in parse
    self._tag_root(de)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 711, in _tag_root
    raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /opt/odoo/auto/addons/l10n_fr_mis_reports/data/mis_report_pl.xml:14, somewhere inside
<record model="mis.report.kpi" id="mis_report_pl_fc">
      <field name="report_id" ref="mis_report_pl"/>
      <field name="name">FC</field>
      <field name="description">Ventes de marchandises</field>
      <field name="expression">-balp[707%,7097%]</field>
      <field name="type">num</field>
      <field name="compare_method">pct</field>
      <field name="auto_expand_accounts" eval="True"/>
      <field name="auto_expand_accounts_style_id" ref="account_detail"/>
      <field name="sequence">2</field>
    </record>