stock_measuring_device: Release device before closing the wizard

This commit is contained in:
Matthieu Méquignon
2021-04-28 14:45:15 +02:00
parent 00d027bc96
commit f3928f47fe

View File

@@ -151,7 +151,11 @@ class MeasuringWizard(models.TransientModel):
self.onchange_product_id() self.onchange_product_id()
def action_close(self): def action_close(self):
self.ensure_one() for line in self.line_ids:
if not line.scan_requested:
continue
line.packaging_id._measuring_device_release()
line.scan_requested = False
return { return {
"type": "ir.actions.act_window", "type": "ir.actions.act_window",
"res_model": self.device_id._name, "res_model": self.device_id._name,