summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2026-01-07 09:37:22 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2026-01-07 09:37:22 +0700
commit43e4cc7ecda2c2637f2ffc88c7ea8efdc2b3cee1 (patch)
tree4f81cf3a65bdc386bee69a023d2a181da1cf62c2
parent794a5bd14560efb1932d562eb2fdff989cc6fa9b (diff)
push
-rwxr-xr-xfixco_custom/models/detail_order.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/fixco_custom/models/detail_order.py b/fixco_custom/models/detail_order.py
index 674f11a..5d05187 100755
--- a/fixco_custom/models/detail_order.py
+++ b/fixco_custom/models/detail_order.py
@@ -5,7 +5,7 @@ import requests
import json
import hmac
import base64
-from datetime import datetime
+from datetime import datetime, timezone
from hashlib import sha256
import logging
@@ -324,12 +324,14 @@ class DetailOrder(models.Model):
create_at_str = json_data.get('data', [{}])[0].get('createAt')
if create_at_str:
- create_at = datetime.strptime(create_at_str, "%Y-%m-%dT%H:%M:%SZ")
+ create_at = datetime.strptime(
+ create_at_str,
+ "%Y-%m-%dT%H:%M:%SZ"
+ ).replace(tzinfo=timezone.utc)
- cutoff = datetime(2026, 1, 1) # 1 Jan 2026 UTC
+ cutoff = datetime(2026, 1, 1, 0, 0, tzinfo=timezone.utc)
if create_at >= cutoff:
-
if order_status == 'CANCELLED':
external_order_id = json_data.get('data', [{}])[0].get('externalOrderId')
order_id = json_data.get('data', [{}])[0].get('orderId')
@@ -420,6 +422,8 @@ class DetailOrder(models.Model):
self.execute_status = 'so_confirm'
else:
self.execute_status = 'so_draft'
+ else:
+ self.execute_status = 'failed'
except Exception as e:
self.write({