diff options
| -rw-r--r-- | ab_openstreetmap/static/src/js/googlemap_widget.js | 25 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 13 |
3 files changed, 25 insertions, 17 deletions
diff --git a/ab_openstreetmap/static/src/js/googlemap_widget.js b/ab_openstreetmap/static/src/js/googlemap_widget.js index e13fac61..cdbd376c 100644 --- a/ab_openstreetmap/static/src/js/googlemap_widget.js +++ b/ab_openstreetmap/static/src/js/googlemap_widget.js @@ -23,17 +23,20 @@ odoo.define("ab_openstreetmap.googlemap_widget", function (require) { }, async _loadGoogle() { - const apiKey = await rpc.query({ - model: "ir.config_parameter", - method: "get_param", - args: ["google.maps.api_key"], - }); - const mapId = await rpc.query({ - model: "ir.config_parameter", - method: "get_param", - args: ["google.maps.map_id"], - }); - + // const apiKey = await rpc.query({ + // model: "ir.config_parameter", + // method: "get_param", + // args: ["google.maps.api_key"], + // }); + // const mapId = await rpc.query({ + // model: "ir.config_parameter", + // method: "get_param", + // args: ["google.maps.map_id"], + // }); + + const apiKey = "AIzaSyD1b2e4g3f8a9c5d6e7f8g9h0i1j2k3l4m"; // Ganti dengan API Key Anda + const mapId = "1af072c8d80a2adec8057f34"; + // Ganti dengan Map ID Anda if (!window.google || !window.google.maps) { const script = document.createElement("script"); script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&v=weekly&libraries=places,marker`; diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 0662522f..1771f210 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1102,7 +1102,9 @@ class SaleOrder(models.Model): def _call_biteship_api(self, origin_data, destination_data, items, couriers=None): url = "https://api.biteship.com/v1/rates/couriers" - api_key = self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_live') + api_key = "biteship_live.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiaW5kb3Rla25payIsInVzZXJJZCI6IjY3MTViYTJkYzVkMjdkMDAxMjRjODk2MiIsImlhdCI6MTc0MTE1NTU4M30.pbFCai9QJv8iWhgdosf8ScVmEeP3e5blrn33CHe7Hgo" + # api_key = "biteship_test.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSW5kb3Rla25payIsInVzZXJJZCI6IjY3MTViYTJkYzVkMjdkMDAxMjRjODk2MiIsImlhdCI6MTcyOTQ5ODAwMX0.L6C73couP4-cgVEfhKI2g7eMCMo3YOFSRZhS-KSuHNA" + # api_key = self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_live') # api_key = self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_test') headers = { 'Authorization': api_key, diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 6eac857c..f552ff3f 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -19,6 +19,9 @@ import re _logger = logging.getLogger(__name__) _biteship_url = "https://api.biteship.com/v1" +biteship_api_key = "biteship_live.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiaW5kb3Rla25payIsInVzZXJJZCI6IjY3MTViYTJkYzVkMjdkMDAxMjRjODk2MiIsImlhdCI6MTc0MTE1NTU4M30.pbFCai9QJv8iWhgdosf8ScVmEeP3e5blrn33CHe7Hgo" +# biteship_api_key = "biteship_test.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSW5kb3Rla25payIsInVzZXJJZCI6IjY3MTViYTJkYzVkMjdkMDAxMjRjODk2MiIsImlhdCI6MTcyOTQ5ODAwMX0.L6C73couP4-cgVEfhKI2g7eMCMo3YOFSRZhS-KSuHNA" + class StockPicking(models.Model): _inherit = 'stock.picking' @@ -165,9 +168,9 @@ class StockPicking(models.Model): area_name = fields.Char(string="Area", compute="_compute_area_name") - def _get_biteship_api_key(self): - # return self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_test') - return self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_live') + # def _get_biteship_api_key(self): + # # return self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_test') + # return self.env['ir.config_parameter'].sudo().get_param('biteship.api_key_live') @api.depends('real_shipping_id.kecamatan_id', 'real_shipping_id.kota_id') def _compute_area_name(self): @@ -762,7 +765,7 @@ class StockPicking(models.Model): _logger.info(f"Payload untuk Biteship: {payload}") # Kirim ke Biteship - api_key = self._get_biteship_api_key() + api_key = biteship_api_key headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" @@ -1705,7 +1708,7 @@ class StockPicking(models.Model): return response def get_manifest_biteship(self): - api_key = self._get_biteship_api_key() + api_key = biteship_api_key headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" |
