Skip to content

Commit

Permalink
[IMP] stock_weighing_auto_create_lot: Adapt to new workflow in stock_…
Browse files Browse the repository at this point in the history
…picking_auto_create_lot module
  • Loading branch information
sergio-teruel authored and chienandalu committed Jul 17, 2024
1 parent b0eddae commit 4fbf875
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions stock_weighing_auto_create_lot/wizards/weighing_wizard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Tecnativa - David Vidal
# Copyright 2024 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models

Expand Down Expand Up @@ -29,6 +30,9 @@ def _lot_creation_constraints(self):

def _post_add_detailed_operation(self):
"""After creating a new detailed operation for lot auto-assigning"""
self.selected_move_line_id.with_context(
bypass_reservation_update=True
).set_lot_auto()
if self.show_auto_lot_info:
lot_sequence = self.env["stock.picking"]._get_lot_sequence()
self.selected_move_line_id.lot_name = lot_sequence
self.selected_move_line_id.with_context(
bypass_reservation_update=True
)._create_and_assign_production_lot()

0 comments on commit 4fbf875

Please sign in to comment.