summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-05-16 08:55:53 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-05-16 08:55:53 +0700
commit24c52892c3143dc2474e5a2ba3c99d08ee1f7d29 (patch)
treec4d3444465e78718bf249223dd407bdd2da5af64 /indoteknik_custom/models
parentcaa3b18640a1cffb80677701da5598f42a795a7d (diff)
(andri) add field date hold/unhold SO
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/sale_order.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 0d4fc6c3..0ae61914 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -4,6 +4,7 @@ from odoo import fields, models, api, _
from odoo.exceptions import UserError, ValidationError
from datetime import datetime, timedelta
import logging, random, string, requests, math, json, re, qrcode, base64
+import pytz
from io import BytesIO
from collections import defaultdict
@@ -302,6 +303,12 @@ class SaleOrder(models.Model):
('hold', 'Hold'),
('approve', 'Approve')
], tracking=True, string='State Cancel', copy=False)
+ hold_outgoing_datetime = fields.Datetime(
+ string='Date Hold/Unhold',
+ tracking=True,
+ readonly=True,
+ help='Waktu terakhir ketika status Hold Outgoing SO berubah'
+ )
def _compute_total_margin_excl_third_party(self):
for order in self:
@@ -340,11 +347,13 @@ class SaleOrder(models.Model):
}
}
- def hold_unhold_qty_outgoing_so(self):
+ def hold_unhold_qty_outgoing_so(self):
if self.hold_outgoing == True:
self.hold_outgoing = False
else:
self.hold_outgoing = True
+
+ self.hold_outgoing_datetime = fields.Datetime.now()
def _validate_uniform_taxes(self):
for order in self: