City doesn't get send to google when housenumber is not present
AtraXionAartselaar opened this issue · 3 comments
Hi
First all great tool you have made; very usefull !
I found an error. When an user only fills in the streetname and not the housenumber. The city ‘locality’ (‘municipality’, ..) doesn't get filled in. So Google responses there is no city... because of that "administrative_area_level_2" get"s filled in as city name which is not correct
In addition you'll find a zip file with a video explaining it. First time I show the bug the second time I show the normal behavior when the housenumer is present.
Response from Google because city was missing:
/**/_xdc_._akyo20 && _xdc_._akyo20( { "html_attributions" : [], "result" : { "address_components" : [ { "long_name" : "Antwerpsestraat", "short_name" : "Antwerpsestraat", "types" : [ "route" ] }, { "long_name" : "Antwerpen", "short_name" : "AN", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Vlaanderen", "short_name" : "Vlaanderen", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "België", "short_name" : "BE", "types" : [ "country", "political" ] } ], "adr_address" : "\u003cspan class=\"street-address\"\u003eAntwerpsestraat\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eBelgië\u003c/span\u003e", "formatted_address" : "Antwerpsestraat", "geometry" : { "location" : { "lat" : 51.0977415, "lng" : 4.3673673 }, "viewport" : { "northeast" : { "lat" : 51.09909048029149, "lng" : 4.368716280291502 }, "southwest" : { "lat" : 51.09639251970849, "lng" : 4.366018319708497 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png", "id" : "6a8d281b4dedc7c4c576eacebed1d2f8a3d0b7d4", "name" : "Antwerpsestraat", "place_id" : "EhhBbnR3ZXJwc2VzdHJhYXQsIEJlbGdpdW0iLiosChQKEgmpPkvg4fHDRxHfREQPaMDxuBIUChIJH4agHvrvw0cR-Gppir5EdpU", "reference" : "EhhBbnR3ZXJwc2VzdHJhYXQsIEJlbGdpdW0iLiosChQKEgmpPkvg4fHDRxHfREQPaMDxuBIUChIJH4agHvrvw0cR-Gppir5EdpU", "scope" : "GOOGLE", "types" : [ "route" ], "url" : "https://maps.google.com/?q=Antwerpsestraat&ftid=0x47c3f1e1e04b3ea9:0xb8f1c0680f4444df", "utc_offset" : 120 }, "status" : "OK" }
@AtraXionAartselaar thank you.
can you tell me what should be the correct address?
actually, you can change the widget component address via widget options
@AtraXionAartselaar Ok, I got the issue and thanks for the explanation
I pushed a new branch https://github.com/gityopie/odoo-addons/tree/12.0-autocomplete-dev and introduced four new modules for the google autocomplete.
Please have a look on that modules (I also fixed your issue there).
For the module sale_maps
, the autocomplete are still there but I would like you to check the new modules instead.
I think sale_maps
it's not relavant anymore just to add the autocomplete on this module and more, I've moved the modification defined on that module to contacts_maps
Waiting your feedback for those new modules :)
Thanks