[IMP] partner_gogocarto_export_api: add button to open the export URL

Add an ``action_open_gogocarto_export`` method on ``res.config.settings``
returning an ``ir.actions.act_url`` (``target="new"``) pointing at the
selected company's export endpoint, exposed as a link-style button next
to the exported fields in the GogoCarto settings block.

Re-add the ``base_setup`` dependency: the new method uses
``res.config.settings.company_id``, which is defined by ``base_setup``
(so is the ``company_id`` our ``export_gogocarto_fields`` related field
already relies on). Its removal in 057e7a2 only worked because
``base_setup`` was pulled in transitively.

Regenerate ``i18n/fr.po`` and the ``.pot`` from a live 18.0 instance,
with the French translation for the new "Open export URL" string. The
stale "Mass Edit In Gogocarto Field" translation (wrongly worded) is
not carried over by the regenerated catalog.

Verified on a local 18.0 instance: 11 tests, 0 failed, 0 error, and the
settings arch renders "Ouvrir l'URL d'export" in French.
This commit is contained in:
Stéphan Sainléger
2026-10-19 00:01:15 +02:00
parent 29e9299940
commit 5fcc128e73
6 changed files with 101 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_config_settings_view_form_gogocarto" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.gogocarto</field>
@@ -7,19 +7,38 @@
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="GogoCarto" string="GogoCarto"
<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.">
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"
<div class="mt16">
<field
name="export_gogocarto_fields"
widget="many2many_tags"
options="{'no_create': True, 'no_open': True}" />
</div>
options="{'no_create': True, 'no_open': True}"
/>
</div>
<button
type="object"
name="action_open_gogocarto_export"
string="Open export URL"
icon="oi-arrow-right"
class="btn-link"
/>
</setting>
</block>
</app>