diff --git a/lims_management/models/stock_lot.py b/lims_management/models/stock_lot.py index 1c37cfc..5bbc29d 100644 --- a/lims_management/models/stock_lot.py +++ b/lims_management/models/stock_lot.py @@ -33,3 +33,27 @@ class StockLot(models.Model): string='Collected by', default=lambda self: self.env.user ) + + state = fields.Selection([ + ('collected', 'Recolectada'), + ('received', 'Recibida en Laboratorio'), + ('in_process', 'En Proceso'), + ('analyzed', 'Analizada'), + ('stored', 'Almacenada'), + ('disposed', 'Desechada') + ], string='Estado', default='collected', tracking=True) + + def action_receive(self): + self.write({'state': 'received'}) + + def action_start_analysis(self): + self.write({'state': 'in_process'}) + + def action_complete_analysis(self): + self.write({'state': 'analyzed'}) + + def action_store(self): + self.write({'state': 'stored'}) + + def action_dispose(self): + self.write({'state': 'disposed'}) diff --git a/lims_management/views/stock_lot_views.xml b/lims_management/views/stock_lot_views.xml index 9c5587a..c5c0c78 100644 --- a/lims_management/views/stock_lot_views.xml +++ b/lims_management/views/stock_lot_views.xml @@ -14,6 +14,7 @@ + @@ -24,6 +25,14 @@ stock.lot
+
+

@@ -32,17 +41,20 @@

- - + + + options="{'no_create': True, 'no_create_edit': True}" + readonly="state != 'collected'"/> - - - + + +