summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-31 10:39:29 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-31 10:39:29 +0700
commit3cc65898e703c4857908b97bc5ab63c8452be684 (patch)
treeac0465f78da9c0efdd4f9acf72aec3d529f6db78 /indoteknik_custom/models/stock_picking.py
parent0831511787b1cd2171d6dd1dd6c2c9da46b64d2e (diff)
parentd426ff142df8b5778398e3b460ff03d02d9e368a (diff)
Merge branch 'production' into cr/auth
# Conflicts: # indoteknik_custom/__manifest__.py
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 626e842d..a5e533b1 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1,6 +1,7 @@
from odoo import fields, models, api, _
from odoo.exceptions import AccessError, UserError, ValidationError
from odoo.tools.float_utils import float_is_zero
+from datetime import datetime
from itertools import groupby
import pytz, datetime
@@ -74,6 +75,7 @@ class StockPicking(models.Model):
purchase_representative_id = fields.Many2one('res.users', related='move_lines.purchase_line_id.order_id.user_id', string="Purchase Representative", readonly=True)
carrier_id = fields.Many2one('delivery.carrier', string='Shipping Method')
shipping_status = fields.Char(string='Shipping Status', compute="_compute_shipping_status")
+ date_reserved = fields.Datetime(string="Date Reserved", help='Tanggal ter-reserved semua barang nya')
def _compute_shipping_status(self):
for rec in self:
@@ -309,6 +311,10 @@ class StockPicking(models.Model):
if product:
product.product_tmpl_id._create_solr_queue('_sync_product_stock_to_solr')
+ if not self.date_reserved:
+ current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
+ self.date_reserved = current_time
+
res = super(StockPicking, self).button_validate()
self.calculate_line_no()
return res