Add manual sync endpoint

This commit is contained in:
cerenX9
2026-07-24 14:15:54 +03:00
parent 27233b2d91
commit 4d9a7f4800

View File

@@ -240,3 +240,11 @@ class MymachFleetController(http.Controller):
except Exception as e: except Exception as e:
return f"ERROR: {str(e)}" return f"ERROR: {str(e)}"
@http.route('/mymach/sync_now', type='http', auth='public', csrf=False)
def force_google_sync(self, **kwargs):
try:
request.env['mymach.fleet.google.sync'].sudo().sync_google_locations()
return "GOOGLE SYNC TETIKLENDI! Lutfen Odoo Haritayi yenileyin."
except Exception as e:
return f"GOOGLE SYNC HATASI: {str(e)}"