summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index d4167609..d25208d1 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1316,7 +1316,6 @@ class StockPicking(models.Model):
self.final_seq = 0
self.set_picking_code_out()
self.send_koli_to_so()
-
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:
@@ -1353,7 +1352,20 @@ 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.state == 'done':
+ po = self.env['purchase.order'].search([
+ ('name', '=', self.group_id.name)
+ ])
+
+ for line in po.order_sales_match_line:
+ if not line.bu_pick:
+ continue
+ line.bu_pick.action_assign()
def check_invoice_date(self):
for picking in self: