summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-09-06 11:33:02 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-09-06 11:33:02 +0700
commitea6364616f5a6ecbcf933249aeb95a7f3c8b4555 (patch)
tree5720f0713937cc0593e5e16e882a7242c24380a1
parentf82137850801cb8d4c8cb482f607b68181ef1cb6 (diff)
<Miqdad> Comment
-rw-r--r--indoteknik_custom/models/sj_tele.py45
1 files changed, 24 insertions, 21 deletions
diff --git a/indoteknik_custom/models/sj_tele.py b/indoteknik_custom/models/sj_tele.py
index c8f7c0c6..c00279ec 100644
--- a/indoteknik_custom/models/sj_tele.py
+++ b/indoteknik_custom/models/sj_tele.py
@@ -3,6 +3,7 @@ from odoo.exceptions import UserError
import requests
import json
import logging, subprocess
+import time
_logger = logging.getLogger(__name__)
@@ -17,29 +18,31 @@ class SjTele(models.Model):
sale_name = fields.Char(string='Sale Name')
create_date = fields.Datetime(string='Create Date')
- @api.model
- def run_pentaho_carte(self):
- carte = "http://127.0.0.1:8080"
- job_kjb = r"C:/Users/ThinkPad/Desktop/tes.kjb"
- params = {"job": job_kjb, "level": "Basic", "block": "Y"}
- try:
- r = requests.get(
- f"{carte}/kettle/executeJob/",
- params=params,
- auth=("cluster", "cluster"),
- timeout=900,
- )
- r.raise_for_status()
- # kalau Carte mengembalikan <result>ERROR</result>, anggap gagal
- if "<result>ERROR</result>" in r.text:
- raise UserError(f"Carte error: {r.text}")
- except Exception as e:
- _logger.exception("Carte call failed: %s", e)
- raise UserError(f"Gagal memanggil Carte: {e}")
+ # @api.model
+ # def run_pentaho_carte(self):
+ # carte = "http://127.0.0.1:8080"
+ # job_kjb = r"C:/Users/Indoteknik/Desktop/tes.kjb"
+ # params = {"job": job_kjb, "level": "Basic", "block": "Y"}
+ # try:
+ # r = requests.get(
+ # f"{carte}/kettle/executeJob/",
+ # params=params,
+ # auth=("cluster", "cluster"),
+ # timeout=900,
+ # )
+ # r.raise_for_status()
+ # # kalau Carte mengembalikan <result>ERROR</result>, anggap gagal
+ # if "<result>ERROR</result>" in r.text:
+ # raise UserError(f"Carte error: {r.text}")
+ # except Exception as e:
+ # _logger.exception("Carte call failed: %s", e)
+ # raise UserError(f"Gagal memanggil Carte: {e}")
+
+ # time.sleep(3)
- self.env['sj.tele'].sudo().woi()
+ # self.env['sj.tele'].sudo().woi()
- return True
+ # return True
def woi(self):
bot_mqdd = '8203414501:AAHy_XwiUAVrgRM2EJzW7sZx9npRLITZpb8'