mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Fix: avoid remove assigned lots on manual assignement
This commit is contained in:
@@ -2,17 +2,7 @@
|
||||
# (c) 2015 Mikel Arregi - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from openerp import api, fields, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
@api.multi
|
||||
def action_assign(self):
|
||||
# This is to assure that stock.pack.operation are reprocessed
|
||||
self.mapped('pack_operation_ids').unlink()
|
||||
return super(StockPicking, self).action_assign()
|
||||
from openerp import fields, models
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
|
||||
@@ -108,6 +108,9 @@ class TestStockQuantManualAssign(common.TransactionCase):
|
||||
wizard.lines_qty)
|
||||
for quant in self.move.reserved_quant_ids:
|
||||
self.assertTrue(quant in selected_quants)
|
||||
wizard.assign_quants()
|
||||
self.assertEqual(len(wizard.quants_lines.filtered('selected')),
|
||||
len(self.move.reserved_quant_ids))
|
||||
|
||||
def test_quant_assign_wizard_after_availability_check(self):
|
||||
self.move.action_assign()
|
||||
|
||||
@@ -44,6 +44,9 @@ class AssignManualQuants(models.TransientModel):
|
||||
move = self.env['stock.move'].browse(self.env.context['active_id'])
|
||||
move.picking_id.mapped('pack_operation_ids').unlink()
|
||||
quants = []
|
||||
# Mark as recompute pack needed
|
||||
if move.picking_id: # pragma: no cover
|
||||
move.picking_id.recompute_pack_op = True
|
||||
for quant_id in move.reserved_quant_ids.ids:
|
||||
move.write({'reserved_quant_ids': [[3, quant_id]]})
|
||||
for line in self.quants_lines:
|
||||
|
||||
Reference in New Issue
Block a user