simple version of google maps directions (take start point of users company); take empty addresses into account
							parent
							
								
									9d5feebe2c
								
							
						
					
					
						commit
						c5a932ebe7
					
				|  | @ -234,6 +234,7 @@ | |||
|                 <filter string="PG Status" domain="[]" context="{'group_by':'assembly_state'}"/> | ||||
|                 <filter string="Rechnungsadresse" domain="[]" context="{'group_by':'partner_invoice_id'}"/> | ||||
|                 <filter string="Auftragsart" domain="[]" context="{'group_by':'order_type'}"/> | ||||
|                 <filter string="Auslieferungsmethode" domain="[]" context="{'group_by':'carrier_id'}"/> | ||||
|                 <filter string="Vertriebskanal" domain="[]" context="{'group_by':'team_id'}"/> | ||||
|                 <filter string="Sachbearbeiter" domain="[]" context="{'group_by' : 'clerk_id'}" /> | ||||
|             </filter> | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ | |||
| # License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). | ||||
| 
 | ||||
| from odoo import api, fields, models, _ | ||||
| from odoo.exceptions import ValidationError | ||||
| import urllib.parse | ||||
| 
 | ||||
| 
 | ||||
|  | @ -26,7 +25,14 @@ class WizardRouteMaps(models.TransientModel): | |||
|                 for so in sale_orders: | ||||
|                     if (so.partner_shipping_id.id not in sid): | ||||
|                         sid.add(so.partner_shipping_id.id) | ||||
|                         address += "/"+urllib.parse.quote(so.partner_shipping_id.street,safe='')+","+so.partner_shipping_id.zip+","+so.partner_shipping_id.city+","+so.partner_shipping_id.country_id.name | ||||
|                         si = so.partner_shipping_id | ||||
| 
 | ||||
|                         street = si.street + ',' if si.street else '' | ||||
|                         zip = ' ' + si.zip + ',' if si.zip else '' | ||||
|                         city = ' ' + si.city + ',' if si.city else '' | ||||
|                         country_code = ' ' + si.country_id.code + ',' if si.country_id.code else '' | ||||
| 
 | ||||
|                         address += "/"+urllib.parse.quote(street,safe='') + zip + urllib.parse.quote(city,safe='') + country_code | ||||
| 
 | ||||
|             gomaps_link = "https://www.google.at/maps/dir/"+home_address+address | ||||
| #            print(gomaps_link) | ||||
|  | @ -36,5 +42,6 @@ class WizardRouteMaps(models.TransientModel): | |||
|         return { | ||||
|             'type': 'ir.actions.act_url', | ||||
|             'url': '%s' % gomaps_link, | ||||
|             'view_mode':'form' | ||||
|             'target':'new', | ||||
| #            'domain': [('id', 'in', active_ids)], | ||||
|         } | ||||
|  |  | |||
|  | @ -19,7 +19,8 @@ | |||
|                             type="object"/> | ||||
|                     <button string="Abbrechen" | ||||
|                             class="btn-default" | ||||
|                             special="cancel"/> | ||||
|                             special="cancel" | ||||
|                     /> | ||||
|                 </footer> | ||||
|             </form> | ||||
|         </field> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue