fix(#67): Corregir error 'Expected singleton' en action_cancel de stock.lot
- Modificar método action_cancel para manejar múltiples registros - Usar bucle for para procesar cada registro individualmente - Mantener la funcionalidad de registro de actividad para cada muestra cancelada
This commit is contained in:
parent
c03afb7f76
commit
dcff505a4f
Binary file not shown.
|
@ -206,13 +206,14 @@ class StockLot(models.Model):
|
||||||
|
|
||||||
def action_cancel(self):
|
def action_cancel(self):
|
||||||
"""Cancel the sample"""
|
"""Cancel the sample"""
|
||||||
old_state = self.state
|
for record in self:
|
||||||
self.write({'state': 'cancelled'})
|
old_state = record.state
|
||||||
self.message_post(
|
record.write({'state': 'cancelled'})
|
||||||
body='Muestra cancelada por %s' % self.env.user.name,
|
record.message_post(
|
||||||
subject='Estado actualizado: Cancelada',
|
body='Muestra cancelada por %s' % self.env.user.name,
|
||||||
message_type='notification'
|
subject='Estado actualizado: Cancelada',
|
||||||
)
|
message_type='notification'
|
||||||
|
)
|
||||||
|
|
||||||
def action_open_rejection_wizard(self):
|
def action_open_rejection_wizard(self):
|
||||||
"""Open the rejection wizard"""
|
"""Open the rejection wizard"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user