summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-11-18 10:16:15 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-11-18 10:16:15 +0700
commitace5065eecb5bcf7072668c88829306dd9b4548a (patch)
tree851e93841d409a997122e91195a42300642c0098 /indoteknik_custom/models/purchase_order.py
parent696a0ef4e25abd39a013503694be11ca2b0645ca (diff)
parent6074d548889ea0bcd489fcc6642eeaec1422cf89 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 4475e777..3312e7fd 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -7,6 +7,8 @@ from pytz import timezone, utc
import io
import base64
from odoo.tools import lazy_property
+import socket
+
try:
from odoo.tools.misc import xlsxwriter
except ImportError:
@@ -121,6 +123,11 @@ class PurchaseOrder(models.Model):
default=True
)
+ @staticmethod
+ def is_local_env():
+ hostname = socket.gethostname().lower()
+ keywords = ['andri', 'miqdad', 'fin', 'stephan', 'hafid', 'nathan']
+ return any(keyword in hostname for keyword in keywords)
@api.onchange('show_description')
def onchange_show_description(self):
@@ -1140,6 +1147,9 @@ class PurchaseOrder(models.Model):
break
if send_email:
+ if self.is_local_env():
+ _logger.warning("📪 Local environment detected — skip sending email reminders.")
+ return
self._send_mail()
if self.revisi_po: