route number switch
Closed this issue · 2 comments
hi, i m in trouble getting this options correct. How is the correct format that the option is filling the street (Route Number) and the geolocation. When i put this in one i get an error - like down both seperate, i also get an error...
`
<attribute name="widget">gplaces_autocomplete</attribute>
<!-- by default address format for street is formatted by street number followed by street name -->
<!-- if the format is different in your country for example, street name followed by street number -->
<!-- you can modify the widget via options -->
<attribute name="options">{
'fillfields': {
'address': {
'street': ['route', 'street_number']
}
}
}</attribute>
<!--
<attribute name="options">{
'fillfields': {
'geolocation': {
'partner_latitude': 'latitude',
'partner_longitude': 'longitude'
}
}
}</attribute>
-->
</field>`
@hmrickhoff to allow the autocomplete fill the geolocation fields automatically, you have to defined the field in fields attributes
for example
<attribute name="widget">gplaces_autocomplete</attribute>
<attribute name="options">{
'fillfields': {
'address': {
'street': ['route', 'street_number']
},
'geolocation': {
'partner_latitude': 'latitude',
'partner_longitude': 'longitude'
}
}
}</attribute>
The address autocomplete widgets have 5 attributes:
- component_form
- address_form
- lat
- lng
- delimeter
the default value configuration are
-
component_form
{
street_number: 'long_name',
route: 'long_name',
intersection: 'short_name',
political: 'short_name',
country: 'short_name',
administrative_area_level_1: 'short_name',
administrative_area_level_2: 'short_name',
administrative_area_level_3: 'short_name',
administrative_area_level_4: 'short_name',
administrative_area_level_5: 'short_name',
colloquial_area: 'short_name',
locality: 'short_name',
ward: 'short_name',
sublocality_level_1: 'short_name',
sublocality_level_2: 'short_name',
sublocality_level_3: 'short_name',
sublocality_level_5: 'short_name',
neighborhood: 'short_name',
premise: 'short_name',
postal_code: 'short_name',
natural_feature: 'short_name',
airport: 'short_name',
park: 'short_name',
point_of_interest: 'long_name'
};
-
address_form
{
street: 'street',
street2: 'street2',
city: 'city',
zip: 'zip',
state_id: 'state_id',
country_id: 'country_id'
}
/*
* key: alias name (please don't change it)
* value: odoo field name
*/
If you defined your address fields different than the one Odoo used, please make sure you specify all of them via widgets options.
oh thanks... i didnt know that their need to be a " , " between these two "fillfields".... thanks a lot!
attribute name="widget">gplaces_autocomplete
{
'fillfields': {
'address': {
'street': ['route', 'street_number']
}, <<<<<<<<
'geolocation': {
'partner_latitude': 'latitude',
'partner_longitude': 'longitude'
}
}
}