summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-01-25 13:18:47 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-01-25 13:18:47 +0700
commitab11e1060a839b5cbd13b56e98fa291cc6a74e38 (patch)
tree086b754f45da8495cd53aefe098436b4ac05aaad
parent90a388356693f34d259ba95c32d3a6ce11a95d77 (diff)
add tracking to unreserved and check_availability button
-rw-r--r--indoteknik_custom/models/stock_picking.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 40c8c1f9..6754ebab 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -80,6 +80,14 @@ class StockPicking(models.Model):
('not_printed', 'Belum Print'),
('printed', 'Printed')
], string='Printed SJ?', copy=False)
+ date_unreserve = fields.Datetime(string="Date Unreserved", copy=False, tracking=True)
+ date_availability = fields.Datetime(string="Date Availability", copy=False, tracking=True)
+
+ def do_unreserve(self):
+ res = super(StockPicking, self).do_unreserve()
+ current_time = datetime.datetime.utcnow()
+ self.date_unreserve = current_time
+ return res
def _compute_shipping_status(self):
for rec in self:
@@ -204,7 +212,9 @@ class StockPicking(models.Model):
def action_assign(self):
res = super(StockPicking, self).action_assign()
+ current_time = datetime.datetime.utcnow()
self.real_shipping_id = self.sale_id.real_shipping_id
+ self.date_availability = current_time
return res
def ask_approval(self):