summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-06-23 16:29:02 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-06-23 16:29:23 +0700
commita6aa700b5016c98d579a52125e3686acc615ce88 (patch)
treecca7b42d53e6a56f534ce4a3e9c28f73bb5fff17 /indoteknik_custom/models/stock_picking.py
parentaf4ee6eef06a440207c6d16809d06e08057f66f0 (diff)
trial automatic reserve and change qty purchase stock
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 7c4e6bc0..27046063 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1309,8 +1309,6 @@ class StockPicking(models.Model):
self.final_seq = 0
self.set_picking_code_out()
self.send_koli_to_so()
- self.automatic_reserve_product()
-
if (self.state_reserve == 'done' and self.picking_type_code == 'internal' and 'BU/PICK/' in self.name
and self.linked_manual_bu_out):
if not self.linked_manual_bu_out.date_reserved:
@@ -1347,10 +1345,18 @@ class StockPicking(models.Model):
'target': 'new',
}
self.send_mail_bills()
+ if 'BU/PUT' in self.name:
+ self.automatic_reserve_product()
return res
- # def automatic_reserve_product(self):
- # if self.name
+ def automatic_reserve_product(self):
+ if self.state == 'done':
+ po = self.env['purchase.order'].search([
+ ('name', '=', self.group_id.name)
+ ])
+
+ for line in po.order_sales_match_line:
+ line.bu_pick.action_assign()
def check_invoice_date(self):
for picking in self: