diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-03 13:46:16 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-03 13:46:16 +0700 |
| commit | e94cfd1fee485d0e84fb50a66a7584572452b5dc (patch) | |
| tree | 7f0e82becba364b8b984ef27df660635d1e1f9f6 /indoteknik_custom/models/stock_picking.py | |
| parent | 566a20db595a2b0a1959a12d289361b16e1ef172 (diff) | |
| parent | 6b49797aca36574497f93a06f8e1c0622e5ad009 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
# Conflicts:
# indoteknik_custom/__manifest__.py
# indoteknik_custom/models/__init__.py
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 6 |
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 |
