diff --git a/lims_management/models/__pycache__/stock_lot.cpython-312.pyc b/lims_management/models/__pycache__/stock_lot.cpython-312.pyc index c5edc30..3f40b00 100644 Binary files a/lims_management/models/__pycache__/stock_lot.cpython-312.pyc and b/lims_management/models/__pycache__/stock_lot.cpython-312.pyc differ diff --git a/lims_management/models/stock_lot.py b/lims_management/models/stock_lot.py index dfe9ef6..8c9110f 100644 --- a/lims_management/models/stock_lot.py +++ b/lims_management/models/stock_lot.py @@ -206,13 +206,14 @@ class StockLot(models.Model): def action_cancel(self): """Cancel the sample""" - old_state = self.state - self.write({'state': 'cancelled'}) - self.message_post( - body='Muestra cancelada por %s' % self.env.user.name, - subject='Estado actualizado: Cancelada', - message_type='notification' - ) + for record in self: + old_state = record.state + record.write({'state': 'cancelled'}) + record.message_post( + body='Muestra cancelada por %s' % self.env.user.name, + subject='Estado actualizado: Cancelada', + message_type='notification' + ) def action_open_rejection_wizard(self): """Open the rejection wizard"""