diff --git a/conf/first_install_tables.json b/conf/first_install_tables.json index cb3c1345..9df3f5ea 100644 --- a/conf/first_install_tables.json +++ b/conf/first_install_tables.json @@ -324,21 +324,32 @@ "model": "core.statesformolecule", "pk": 3, "fields": { - "molecule_state_name": "Defined" + "molecule_state_name": "defined", + "molecule_state_display": "Defined" } }, { "model": "core.statesformolecule", "pk": 4, "fields": { - "molecule_state_name": "Assigned Protocol" + "molecule_state_name": "assigned_parameters", + "molecule_state_display": "Assigned Parameters" } }, { "model": "core.statesformolecule", "pk": 5, "fields": { - "molecule_state_name": "Completed" + "molecule_state_name": "completed", + "molecule_state_display": "Completed" + } +}, +{ + "model": "core.statesformolecule", + "pk": 6, + "fields": { + "molecule_state_name": "sent_external", + "molecule_state_display": "Sent to external service" } }, { diff --git a/core/core_config.py b/core/core_config.py index 1c5d034a..d41b2157 100644 --- a/core/core_config.py +++ b/core/core_config.py @@ -22,7 +22,7 @@ ] HEADING_FOR_MOLECULE_ADDING_PARAMETERS = [ "Sample", - "Molecule Code ID", + "Extraction Code ID", "Lot Commercial Kit", ] @@ -74,8 +74,8 @@ HEADING_FOR_SELECTING_MOLECULE_USE = [ "Sample Name", - "Molecule CodeID", - "Molecule use for", + "Extraction CodeID", + "Sample continue on", ] # ################ PROTOCOL PARAMETER SETTINGS ############################## diff --git a/core/models.py b/core/models.py index 32d32ff2..5c51efb6 100644 --- a/core/models.py +++ b/core/models.py @@ -372,6 +372,7 @@ def get_id(self): class StatesForMolecule(models.Model): molecule_state_name = models.CharField(max_length=50) + molecule_state_display = models.CharField(max_length=80, null=True, blank=True) class Meta: db_table = "core_states_for_molecule" @@ -1495,7 +1496,7 @@ def create_molecule(self, molecule_data): protocol_used=protocol_used_obj, sample=molecule_data["sample"], molecule_type=molecule_used_obj, - state=StatesForMolecule.objects.get(molecule_state_name__exact="Defined"), + state=StatesForMolecule.objects.get(molecule_state_name__exact="defined"), molecule_code_id=molecule_data["molecule_code_id"], molecule_extraction_date=molecule_data["molecule_extraction_date"], extraction_type=molecule_data["extraction_type"], diff --git a/core/utils/samples.py b/core/utils/samples.py index 3e7b22f7..3c67d8a2 100644 --- a/core/utils/samples.py +++ b/core/utils/samples.py @@ -565,7 +565,7 @@ def add_molecule_protocol_parameters(data, parameters): molecule_parameter_value ) - molecule_obj.set_state("Completed") + molecule_obj.set_state("assigned_parameters") # Update sample state sample_obj = molecule_obj.get_sample_obj() sample_obj.set_state("Pending for use") @@ -701,10 +701,10 @@ def create_table_molecule_pending_use(sample_list, app_name): use_type = {} use_type["data"] = list( core.models.MoleculePreparation.objects.filter( - molecule_used_for=None, sample__in=sample_list - ) - .exclude(state__molecule_state_name="Completed") - .values_list("sample__sample_name", "molecule_code_id", "pk") + molecule_used_for=None, + sample__in=sample_list, + state__molecule_state_name="assigned_parameters", + ).values_list("sample__sample_name", "molecule_code_id", "pk") ) if len(use_type["data"]) > 0: if core.models.MoleculeUsedFor.objects.filter( diff --git a/wetlab/templates/wetlab/handling_molecules.html b/wetlab/templates/wetlab/handling_molecules.html index 84a9f4e7..89f5270d 100644 --- a/wetlab/templates/wetlab/handling_molecules.html +++ b/wetlab/templates/wetlab/handling_molecules.html @@ -108,15 +108,15 @@