diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-08-08 15:11:35 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-08-08 15:11:35 +0700 |
| commit | da1903796553ca0ee5195a7962521bc09b4b98a8 (patch) | |
| tree | 0fe68309a748a74e121c9f9c51cb4b047e7cd217 /indoteknik_custom/models/stock_picking.py | |
| parent | 7ebcf1675e55dae39f769466e5bf5ef064646f27 (diff) | |
| parent | 19067dfea850b289b47d70ab36628b796ae87265 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into reminder-tempo-v2
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index f2f5f52a..46bb6cee 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1059,17 +1059,21 @@ class StockPicking(models.Model): return self.sale_id.date_doc_kirim = self.date_doc_kirim + from odoo import fields + def action_assign(self): - res = super(StockPicking, self).action_assign() - for move in self: - # if not move.sale_id.hold_outgoing and move.location_id.id != 57 and move.location_dest_id.id != 60: - # TODO cant skip hold outgoing cause of not singleton method - current_time = datetime.datetime.utcnow() - move.real_shipping_id = move.sale_id.real_shipping_id - move.date_availability = current_time - # self.check_state_reserve() + pickings_to_assign = self.filtered(lambda p: not (p.sale_id and p.sale_id.hold_outgoing)) + + res = super(StockPicking, pickings_to_assign).action_assign() + + current_time = datetime.datetime.utcnow() + for picking in pickings_to_assign: + picking.real_shipping_id = picking.sale_id.real_shipping_id + picking.date_availability = current_time + return res + def ask_approval(self): if self.env.user.is_accounting: raise UserError("Bisa langsung Validate") |
