How can i get the Geolocation of the user with lattitude and longitude when he fills the timesheet in odoo.
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
            
                2
                
                    回覆
                
            
        
        
            
                2278
                
                    瀏覽次數
                
            
        
    I tried this but doesnt work!
You could use Javascript for this:
<script>
$( document ).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
console.log("Geolocation is not supported by this browser.");
}
function showPosition(position) {
console.log("Latitude: " + position.coords.latitude +
" | Longitude: " + position.coords.longitude);
}
});
</script>
You would still need additional OWL component to attach these values to your timesheet form:
https://www.odoo.com/documentation/16.0/developer/reference/frontend/owl_components.html
I hope this at least points you into the right direction!
| 相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
|---|---|---|---|---|
|  | 5 9月 25  | 23424 | ||
|  | 3 8月 25  | 3509 | ||
|  | 1 5月 25  | 3395 | ||
|  | 1 4月 25  | 4297 | ||
|  | 1 4月 25  | 5105 | 
