I'm looking for a way to refresh the geolocation and geocode coordinates for all contacts. There is a post here for v15, I am running v16 community and had no luck with that scheduled action. The v15 code was:
partner_ids = env["res.partner"].search([])
for partner_id in partner_ids:
partner_id.geo_localize()
Which on my install of v16 community returned this:
"Unable to geolocate, received the error: Invalid request. Missing the 'address', 'components', 'latlng' or 'place_id' parameter."
And yes, manually clicking "Compute based on address" in the form view for a contact does work. I confirmed this and made sure it is not an API issue.
Any help is greatly appreciated!
In some records there are required parameters not set that's why it's showing you message.
Ah, there were some records with no address. This has been fixed and the task now runs but it only geolocated a few hundred contacts. I got no error messages though so I'm not sure what is stopping it from doing all of my 2,000+ contacts.