[FIX] partner_geolocalize_usability: avoid Nominatim HTTP 429 rejections #21
Reference in New Issue
Block a user
No description provided.
Delete Branch "18.0-fix-osm-geolocalization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The stock
base_geocoder._call_openstreetmapsends a generic OdooUser-Agentshared across thousands of instances, which Nominatimrate-limits and blocks (HTTP 429 "Too many requests"), so mass
geolocation fails regardless of client-side throttling.
Override
_call_openstreetmapto:User-Agentread from a new systemparameter
partner_geolocalize_usability.user_agent(shipped with anobvious placeholder so an unconfigured instance fails loudly instead of
silently reusing the banned generic agent);
time.sleep) before each call,complying with the Nominatim usage policy even when callers loop over
many partners;
Noneinstead of raisingIndexErrorwhen Nominatimreturns 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.