[FIX] partner_gogocarto_export_api: restore GogoCarto entry in settings menu

The migration to 18.0 anchored the settings block inside the
"General Settings" app (after Contacts). In 18.0 the settings side
menu is built exclusively from ``<app>`` elements
(``web/static/src/webclient/settings_form_view/settings_form_compiler.js``),
so the block rendered but the dedicated "GogoCarto" menu entry the
16.0 view provided (``app_settings_block`` with ``data-key``) was
gone.

Declare a dedicated ``<app>`` injected at form level (same pattern as
core ``calendar``), which restores the menu entry; the block and its
translatable strings are unchanged. The ``base_setup`` dependency is
no longer needed and is dropped.

Add a regression test asserting the app exists in the combined arch.
Verified on a local 18.0 instance: 10 tests, 0 failed, 0 error, and
the combined form arch exposes the app at top level.
This commit is contained in:
Stéphan Sainléger
2026-10-18 23:53:05 +02:00
parent 9fc914ede2
commit 29e9299940
4 changed files with 39 additions and 16 deletions

View File

@@ -8,7 +8,6 @@
"version": "18.0.1.0.0",
"depends": [
"base",
"base_setup",
"contacts",
"base_geolocalize",
"partner_geolocalize_usability",

View File

@@ -1,2 +1,3 @@
from . import test_controller
from . import test_res_partner
from . import test_settings_view

View File

@@ -0,0 +1,19 @@
from odoo.tests.common import TransactionCase
class TestGogocartoSettingsView(TransactionCase):
"""Regression tests of the settings view structure."""
def test_settings_menu_entry_exists(self):
"""A dedicated ``<app>`` must exist so GogoCarto gets its own entry
in the settings side menu: in 18.0 the menu is built exclusively
from ``<app>`` elements, blocks buried in another app's tab are
not listed."""
arch = self.env["res.config.settings"].get_view(
view_id=self.env.ref(
"partner_gogocarto_export_api.res_config_settings_view_form_gogocarto"
).id,
view_type="form",
)["arch"]
self.assertIn('name="partner_gogocarto_export_api"', arch)
self.assertIn("export_gogocarto_fields", arch)

View File

@@ -4,22 +4,26 @@
<field name="name">res.config.settings.view.form.inherit.gogocarto</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="99" />
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<block name="contacts_setting_container" position="after">
<block title="GogoCarto export configuration" name="gogocarto_settings" id="gogocarto_selection_settings">
<setting id="gogocarto_fields" help="Partner fields to export for Gogocarto map.">
<div class="text-muted">
Check the export on /web/{COMPANY_ID}/get_http_gogocarto_elements.
</div>
<div class="mt16">
<field name="export_gogocarto_fields"
widget="many2many_tags"
options="{'no_create': True, 'no_open': True}" />
</div>
</setting>
</block>
</block>
<xpath expr="//form" position="inside">
<app data-string="GogoCarto" string="GogoCarto"
name="partner_gogocarto_export_api"
logo="/partner_gogocarto_export_api/static/description/icon.png">
<block title="GogoCarto export configuration" name="gogocarto_settings" id="gogocarto_selection_settings">
<setting id="gogocarto_fields" help="Partner fields to export for Gogocarto map.">
<div class="text-muted">
Check the export on /web/{COMPANY_ID}/get_http_gogocarto_elements.
</div>
<div class="mt16">
<field name="export_gogocarto_fields"
widget="many2many_tags"
options="{'no_create': True, 'no_open': True}" />
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>