[FIX] stock: start a finished inventory
Avoids launching a canceled/done inventory. Closes #21697 opw-800347
This commit is contained in:
committed by
Nicolas Martinelli
parent
ed8fc8f52b
commit
45015ea7b7
@@ -184,7 +184,7 @@ class Inventory(models.Model):
|
||||
})
|
||||
|
||||
def action_start(self):
|
||||
for inventory in self:
|
||||
for inventory in self.filtered(lambda x: x.state not in ('done','cancel')):
|
||||
vals = {'state': 'confirm', 'date': fields.Datetime.now()}
|
||||
if (inventory.filter != 'partial') and not inventory.line_ids:
|
||||
vals.update({'line_ids': [(0, 0, line_values) for line_values in inventory._get_inventory_lines_values()]})
|
||||
|
||||
Reference in New Issue
Block a user