Add unit tests on the parser/domain helpers and end-to-end tests of
the public JSON endpoint:
- ``tests/test_res_partner.py``: pins the Gogocarto data contract
(default domain and field set, company-selected fields, parser
mapping of scalar/relational/binary/unsupported ttypes). A silent
regression there corrupts the map feed while the endpoint keeps
answering 200.
- ``tests/test_controller.py``: anonymous ``HttpCase`` calls on
``/web/<company_id>/get_http_gogocarto_elements`` covering the
flagged-partners payload, the exclusion of unflagged partners and
the graceful degradation on unknown company ids.
Verified on a local 18.0 instance: 9 tests, 0 failed, 0 error.
Migrated from 16.0.1.0.1 following the OCA migration guidelines:
- ``with_context(force_company=...)`` replaced by ``.with_company(...)``
in the controller: the ``force_company`` context key is no longer
supported and logs a warning in 18.0.
- Settings view rewritten for the 17.0+ settings structure: the legacy
``<div class="app_settings_block">`` / ``hasclass('settings')`` anchor
is gone. The block now follows the ``<block>``/``<setting>`` idiom and
inherits ``base_setup.res_config_settings_view_form``; the
``base_setup`` dependency was added accordingly. Translatable strings
are kept verbatim so the ``fr.po`` catalog stays valid.
- Fixed the ``posiion`` -> ``position`` typo in the company form
inheritance (silently defaulted to ``inside`` since 16.0).
- Version bumped to ``18.0.1.0.0``; author normalized to a
comma-separated string (pylint manifest-author-string).
Dependencies verified on 18.0: ``jsonifier`` (OCA server-tools) still
provides ``jsonify(parser)``, ``server_action_mass_edit`` (OCA
server-ux) still provides ``ir.actions.server.mass.edit.line`` and the
core ``ir.actions.server.create_action`` used by the mass-edit record.
Verified on a local 18.0 instance: clean install, and
``GET /web/<company_id>/get_http_gogocarto_elements`` returns the
expected JSON payload (flagged partners only, unknown company yields
``[]``, no ``force_company`` warnings in logs).
The stock ``base_geocoder._call_openstreetmap`` sends a generic Odoo
``User-Agent`` shared across thousands of instances, which Nominatim
rate-limits and blocks (HTTP 429 "Too many requests"), so mass
geolocation fails regardless of client-side throttling.
Override ``_call_openstreetmap`` to:
- send a deployment-specific ``User-Agent`` read from a new system
parameter ``partner_geolocalize_usability.user_agent`` (shipped with an
obvious placeholder so an unconfigured instance fails loudly instead of
silently reusing the banned generic agent);
- throttle requests to one per second (``time.sleep``) before each call,
complying with the Nominatim usage policy even when callers loop over
many partners;
- return ``None`` instead of raising ``IndexError`` when Nominatim
returns an empty result for an unknown address.
Document the required system parameter in the README and add tests
covering the User-Agent selection, throttling and empty/blank results.