summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-08-08 10:09:25 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-08-08 10:09:25 +0700
commit00cb2b4dcf1e6892a6b4943b08c3bd3f5810432b (patch)
tree67ffdda3812ec8a91e6303dea85e3ec03aa34bb8
parent176dd85c3d809c035128847378bf78d96aa0896a (diff)
fix hold outgoing reserve
-rw-r--r--indoteknik_custom/models/approval_payment_term.py2
-rw-r--r--indoteknik_custom/models/stock_picking.py20
2 files changed, 13 insertions, 9 deletions
diff --git a/indoteknik_custom/models/approval_payment_term.py b/indoteknik_custom/models/approval_payment_term.py
index 6c857b45..a2ecd27f 100644
--- a/indoteknik_custom/models/approval_payment_term.py
+++ b/indoteknik_custom/models/approval_payment_term.py
@@ -38,7 +38,7 @@ class ApprovalPaymentTerm(models.Model):
('approved', 'Approved'),
('rejected', 'Rejected')],
default='waiting_approval_sales_manager', tracking=True)
- reason_reject = fields.Selection([('reason1', 'Reason 1'), ('reason2', 'Reason 2'), ('reason3', 'Reason 3')], string='Reason Reject', tracking=True)
+ reason_reject = fields.Text(string='Reason Reject', tracking=True)
sale_order_ids = fields.Many2many(
'sale.order',
string='Sale Orders',
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")