diff options
Diffstat (limited to 'archaeological_operations')
| -rw-r--r-- | archaeological_operations/admin.py | 4 | ||||
| -rw-r--r-- | archaeological_operations/forms.py | 95 | ||||
| -rw-r--r-- | archaeological_operations/locale/django.pot | 357 | ||||
| -rw-r--r-- | archaeological_operations/models.py | 2 | ||||
| -rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 10 |
5 files changed, 265 insertions, 203 deletions
diff --git a/archaeological_operations/admin.py b/archaeological_operations/admin.py index 34e6da2ca..9f886bc62 100644 --- a/archaeological_operations/admin.py +++ b/archaeological_operations/admin.py @@ -30,6 +30,10 @@ class AdministrativeActAdmin(HistorizedObjectAdmin): 'act_type') list_filter = ('act_type',) search_fields = ('year', 'index') + readonly_fields = ('in_charge', 'operator', 'scientist', 'signatory', + 'operation', 'associated_file', 'imports', + 'departments_label', 'towns_label', + 'history_modifier', 'history_creator') model = models.AdministrativeAct admin.site.register(models.AdministrativeAct, AdministrativeActAdmin) diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 84af8f287..6ef3d5a21 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -235,15 +235,26 @@ class ParcelFormSet(FormSet): values[number] = {} values[number][field] = value + if field == 'parcel': + if not value: + continue + try: + parcel = models.Parcel.objects.get(pk=value) + except models.Parcel.DoesNotExist: + continue + ordering_keys[number] = [ + parcel.town, parcel.year, parcel.section, + parcel.parcel_number] + continue if number not in ordering_keys: ordering_keys[number] = ['', '', '', ''] if field == 'town': ordering_keys[number][0] = value - if field == 'year': + elif field == 'year': ordering_keys[number][1] = value - if field == 'section': + elif field == 'section': ordering_keys[number][2] = value - if field == 'parcel_number': + elif field == 'parcel_number': ordering_keys[number][3] = value reverse_ordering_keys = {} @@ -365,6 +376,17 @@ class RecordRelationsForm(forms.Form): for rel, opes in nc]) return rendered + def clean(self): + cleaned_data = self.cleaned_data + if (cleaned_data.get('relation_type', None) and + not cleaned_data.get('right_record', None)): + raise forms.ValidationError(_(u"You should select an operation.")) + if (not cleaned_data.get('relation_type', None) and + cleaned_data.get('right_record', None)): + raise forms.ValidationError( + _(u"You should select a relation type.")) + return cleaned_data + @classmethod def get_formated_datas(cls, cleaned_datas): result, current, deleted = [], [], [] @@ -466,12 +488,12 @@ class OperationSelect(TableSelect): report_processing = forms.ChoiceField(label=_(u"Report processing"), choices=[]) virtual_operation = forms.NullBooleanField(label=_(u"Virtual operation")) - # archaeological_sites = forms.IntegerField( - # label=_("Archaelogical site"), - # widget=widgets.JQueryAutoComplete( - # reverse_lazy('autocomplete-archaeologicalsite'), - # associated_model=models.ArchaeologicalSite), - # validators=[valid_id(models.ArchaeologicalSite)]) + archaeological_sites = forms.IntegerField( + label=_("Archaelogical site"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-archaeologicalsite'), + associated_model=models.ArchaeologicalSite), + validators=[valid_id(models.ArchaeologicalSite)]) history_creator = forms.IntegerField( label=_(u"Created by"), widget=widgets.JQueryAutoComplete( @@ -670,7 +692,7 @@ class OperationFormGeneral(forms.Form): 'operator': Organization, 'operation_type': models.OperationType, 'report_processing': models.ReportState, - 'archaeological_site': models.ArchaeologicalSite} + } pk = forms.IntegerField(required=False, widget=forms.HiddenInput) if settings.COUNTRY == 'fr': code_patriarche = forms.IntegerField(label=u"Code PATRIARCHE", @@ -683,10 +705,6 @@ class OperationFormGeneral(forms.Form): initial=lambda: datetime.datetime.now().year, validators=[validators.MinValueValidator(1900), validators.MaxValueValidator(2100)]) - operation_code = forms.IntegerField( - label=_(u"Operation code"), - initial=models.Operation.get_available_operation_code, - widget=OperationCodeInput(attrs={'readonly': 'readonly'})) scientist = forms.IntegerField( label=_("Head scientist"), widget=widgets.JQueryAutoComplete( @@ -719,9 +737,9 @@ class OperationFormGeneral(forms.Form): label=_(u"Total surface (m2)"), validators=[validators.MinValueValidator(0), validators.MaxValueValidator(999999999)]) - archaeological_site = widgets.MultipleAutocompleteField( - model=models.ArchaeologicalSite, - label=_("Associated archaeological sites"), new=True, required=False) + # archaeological_site = widgets.MultipleAutocompleteField( + # model=models.ArchaeologicalSite, + # label=_("Associated archaeological sites"), new=True, required=False) start_date = forms.DateField( label=_(u"Start date"), required=False, widget=widgets.JQueryDate) excavation_end_date = forms.DateField( @@ -768,10 +786,12 @@ class OperationFormGeneral(forms.Form): models.ReportState.get_help() self.fields['record_quality'].choices = \ [('', '--')] + list(models.QUALITY) - # data POSTED - if kwargs and kwargs['data'] \ - and 'readonly' in self.fields['operation_code'].widget.attrs: - self.fields['operation_code'].widget.attrs.pop('readonly') + if 'operation_code' in self.fields: + self.fields.keyOrder = list(self.fields.keyOrder) + self.fields.keyOrder.pop(self.fields.keyOrder.index( + 'operation_code')) + self.fields.keyOrder.insert(self.fields.keyOrder.index('year'), + 'operation_code') def clean(self): cleaned_data = self.cleaned_data @@ -787,7 +807,9 @@ class OperationFormGeneral(forms.Form): _(u"The excavation end date cannot be before the start " u"date.")) year = self.cleaned_data.get("year") - operation_code = cleaned_data.get("operation_code") + operation_code = cleaned_data.get("operation_code", None) + if not operation_code: + return self.cleaned_data ops = models.Operation.objects.filter(year=year, operation_code=operation_code) # manage unique operation ID @@ -917,6 +939,32 @@ SelectedParcelGeneralFormSet = formset_factory(ParcelForm, can_delete=True, formset=ParcelFormSet) SelectedParcelGeneralFormSet.form_label = _("Parcels") +""" +class SelectedParcelFormSet(forms.Form): + form_label = _("Parcels") + base_model = 'parcel' + associated_models = {'parcel': models.Parcel} + parcel = forms.MultipleChoiceField( + label=_("Parcel"), required=False, choices=[], + widget=forms.CheckboxSelectMultiple) + + def __init__(self, *args, **kwargs): + parcels = None + print(kwargs) + if 'data' in kwargs and 'PARCELS' in kwargs['data']: + parcels = kwargs['data']['PARCELS'] + # clean data if not "real" data + prefix_value = kwargs['prefix'] + '-parcel' + if not [k for k in kwargs['data'].keys() + if k.startswith(prefix_value) and kwargs['data'][k]]: + kwargs['data'] = None + if 'files' in kwargs: + kwargs.pop('files') + super(SelectedParcelFormSet, self).__init__(*args, **kwargs) + if parcels: + self.fields['parcel'].choices = [('', '--')] + parcels +""" + class RemainForm(forms.Form): form_label = _("Remain types") @@ -1000,7 +1048,8 @@ class ArchaeologicalSiteBasicForm(forms.Form): reverse_lazy('autocomplete-archaeologicalsite'), associated_model=models.ArchaeologicalSite, new=True), - validators=[valid_id(models.ArchaeologicalSite)]) + validators=[valid_id(models.ArchaeologicalSite)], + required=False) ArchaeologicalSiteFormSet = formset_factory(ArchaeologicalSiteBasicForm, diff --git a/archaeological_operations/locale/django.pot b/archaeological_operations/locale/django.pot index b78e36c6c..969d77335 100644 --- a/archaeological_operations/locale/django.pot +++ b/archaeological_operations/locale/django.pot @@ -4,15 +4,16 @@ # Étienne Loks <etienne.loks at peacefrogs net>, 2010-2015. # Étienne Loks <etienne.loks@iggdrasil.net>, 2015. #zanata # Valérie-Emma Leroux <emma@iggdrasil.net>, 2016. #zanata +# Étienne Loks <etienne.loks@iggdrasil.net>, 2016. #zanata msgid "" msgstr "" -#: forms.py:66 forms.py:333 forms.py:892 forms.py:914 forms.py:918 -#: models.py:780 templates/ishtar/blocks/window_tables/parcels.html:8 +#: forms.py:66 forms.py:333 forms.py:903 forms.py:925 forms.py:929 +#: models.py:782 templates/ishtar/blocks/window_tables/parcels.html:8 msgid "Parcels" msgstr "" -#: forms.py:69 forms.py:185 forms.py:868 models.py:770 +#: forms.py:69 forms.py:185 forms.py:879 models.py:772 #: templates/ishtar/blocks/window_tables/parcels.html:5 #: templates/ishtar/dashboards/dashboard_operation.html:302 #: templates/ishtar/dashboards/dashboard_operation.html:315 @@ -21,18 +22,18 @@ msgstr "" msgid "Town" msgstr "" -#: forms.py:71 forms.py:411 forms.py:682 forms.py:1099 models.py:158 -#: models.py:587 models.py:768 +#: forms.py:71 forms.py:422 forms.py:693 forms.py:1111 models.py:158 +#: models.py:589 models.py:770 #: templates/ishtar/blocks/window_tables/parcels.html:6 msgid "Year" msgstr "" -#: forms.py:74 models.py:771 +#: forms.py:74 models.py:773 #: templates/ishtar/blocks/window_tables/parcels.html:7 msgid "Section" msgstr "" -#: forms.py:77 models.py:772 +#: forms.py:77 models.py:774 msgid "Parcel number" msgstr "" @@ -64,8 +65,8 @@ msgstr "" msgid "Relation type" msgstr "" -#: forms.py:345 ishtar_menu.py:30 models.py:237 models.py:488 models.py:513 -#: models.py:528 models.py:579 models.py:767 wizards.py:338 wizards.py:349 +#: forms.py:345 ishtar_menu.py:30 models.py:237 models.py:490 models.py:515 +#: models.py:530 models.py:581 models.py:769 wizards.py:338 wizards.py:349 #: templates/ishtar/sheet_operation.html:6 msgid "Operation" msgstr "" @@ -74,27 +75,35 @@ msgstr "" msgid ":" msgstr "" -#: forms.py:395 +#: forms.py:372 forms.py:548 forms.py:1083 +msgid "You should select an operation." +msgstr "" + +#: forms.py:376 +msgid "You should select a relation type." +msgstr "" + +#: forms.py:406 msgid "Current relations" msgstr "" -#: forms.py:397 +#: forms.py:408 msgid "Deleted relations" msgstr "" -#: forms.py:401 templates/ishtar/sheet_operation.html:115 +#: forms.py:412 templates/ishtar/sheet_operation.html:115 msgid "Relations" msgstr "" -#: forms.py:412 +#: forms.py:423 msgid "Numeric reference" msgstr "" -#: forms.py:417 forms.py:1109 +#: forms.py:428 forms.py:1121 msgid "Parcel (section/number)" msgstr "" -#: forms.py:420 forms.py:1112 models.py:489 +#: forms.py:431 forms.py:1124 models.py:491 #: templates/ishtar/dashboards/dashboard_operation.html:273 #: templates/ishtar/dashboards/dashboard_operation.html:286 #: templates/ishtar/dashboards/dashboard_operation.html:453 @@ -102,397 +111,389 @@ msgstr "" msgid "Department" msgstr "" -#: forms.py:421 forms.py:953 models.py:77 +#: forms.py:432 forms.py:964 models.py:77 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:6 msgid "Name" msgstr "" -#: forms.py:423 forms.py:604 forms.py:680 forms.py:1076 models.py:166 +#: forms.py:434 forms.py:615 forms.py:691 forms.py:1088 models.py:166 msgid "Operation type" msgstr "" -#: forms.py:425 +#: forms.py:436 msgid "Is open?" msgstr "" -#: forms.py:434 forms.py:710 models.py:155 +#: forms.py:445 forms.py:717 models.py:155 msgid "In charge" msgstr "" -#: forms.py:441 models.py:573 +#: forms.py:452 models.py:575 msgid "Scientist in charge" msgstr "" -#: forms.py:443 forms.py:606 forms.py:701 models.py:153 +#: forms.py:454 forms.py:617 forms.py:708 models.py:153 msgid "Operator" msgstr "" -#: forms.py:450 forms.py:958 models.py:81 models.py:168 +#: forms.py:461 forms.py:969 models.py:81 models.py:168 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:8 msgid "Remains" msgstr "" -#: forms.py:451 forms.py:937 forms.py:955 models.py:79 models.py:173 +#: forms.py:462 forms.py:948 forms.py:966 models.py:79 models.py:173 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:7 msgid "Periods" msgstr "" -#: forms.py:452 +#: forms.py:463 msgid "Started before" msgstr "" -#: forms.py:454 +#: forms.py:465 msgid "Started after" msgstr "" -#: forms.py:456 +#: forms.py:467 msgid "Ended before" msgstr "" -#: forms.py:458 +#: forms.py:469 msgid "Ended after" msgstr "" -#: forms.py:461 +#: forms.py:472 msgid "Search within relations" msgstr "" -#: forms.py:463 forms.py:752 models.py:219 +#: forms.py:474 forms.py:759 models.py:219 msgid "Comment" msgstr "" -#: forms.py:464 +#: forms.py:475 msgid "Abstract (full text search)" msgstr "" -#: forms.py:465 forms.py:754 models.py:231 +#: forms.py:476 forms.py:761 models.py:231 msgid "Record quality" msgstr "" -#: forms.py:466 forms.py:733 models.py:185 +#: forms.py:477 forms.py:740 models.py:185 msgid "Report processing" msgstr "" -#: forms.py:468 forms.py:757 models.py:226 +#: forms.py:479 forms.py:764 models.py:226 msgid "Virtual operation" msgstr "" -#: forms.py:476 forms.py:1116 +#: forms.py:481 forms.py:1009 +msgid "Archaelogical site" +msgstr "" + +#: forms.py:487 forms.py:1128 msgid "Created by" msgstr "" -#: forms.py:482 forms.py:1122 +#: forms.py:493 forms.py:1134 msgid "Modified by" msgstr "" -#: forms.py:524 forms.py:1069 views.py:231 +#: forms.py:535 forms.py:1081 views.py:231 msgid "Operation search" msgstr "" -#: forms.py:537 forms.py:1071 -msgid "You should select an operation." -msgstr "" - -#: forms.py:568 +#: forms.py:579 msgid "Associated file" msgstr "" -#: forms.py:572 forms.py:816 models.py:584 wizards.py:76 +#: forms.py:583 forms.py:827 models.py:586 wizards.py:76 msgid "Archaelogical file" msgstr "" -#: forms.py:579 forms.py:581 models.py:233 +#: forms.py:590 forms.py:592 models.py:233 msgid "Abstract" msgstr "" -#: forms.py:584 +#: forms.py:595 msgid "months" msgstr "" -#: forms.py:584 +#: forms.py:595 msgid "years" msgstr "" -#: forms.py:586 models.py:139 +#: forms.py:597 models.py:139 msgid "Creation date" msgstr "" -#: forms.py:587 +#: forms.py:598 msgid "Start of field work" msgstr "" -#: forms.py:589 +#: forms.py:600 msgid "All" msgstr "" -#: forms.py:590 +#: forms.py:601 msgid "Preventive" msgstr "" -#: forms.py:591 +#: forms.py:602 msgid "Research" msgstr "" -#: forms.py:595 +#: forms.py:606 msgid "Slicing" msgstr "" -#: forms.py:598 +#: forms.py:609 msgid "Department detail" msgstr "" -#: forms.py:600 +#: forms.py:611 msgid "Date get from" msgstr "" -#: forms.py:602 +#: forms.py:613 msgid "Preventive/Research" msgstr "" -#: forms.py:608 +#: forms.py:619 msgid "Date after" msgstr "" -#: forms.py:610 +#: forms.py:621 msgid "Date before" msgstr "" -#: forms.py:612 +#: forms.py:623 msgid "With reports" msgstr "" -#: forms.py:613 +#: forms.py:624 msgid "With finds" msgstr "" -#: forms.py:665 forms.py:1169 templates/ishtar/sheet_administrativeact.html:11 +#: forms.py:676 forms.py:1181 templates/ishtar/sheet_administrativeact.html:11 #: templates/ishtar/sheet_operation.html:32 msgid "General" msgstr "" -#: forms.py:678 models.py:218 +#: forms.py:689 models.py:218 msgid "Generic name" msgstr "" -#: forms.py:687 forms.py:812 models.py:159 models.py:368 -msgid "Operation code" -msgstr "" - -#: forms.py:691 +#: forms.py:698 msgid "Head scientist" msgstr "" -#: forms.py:707 models.py:217 +#: forms.py:714 models.py:217 msgid "Operator reference" msgstr "" -#: forms.py:719 +#: forms.py:726 msgid "Total surface (m2)" msgstr "" -#: forms.py:724 -msgid "Associated archaeological sites" -msgstr "" - -#: forms.py:726 models.py:49 models.py:142 models.py:938 +#: forms.py:733 models.py:49 models.py:142 models.py:940 msgid "Start date" msgstr "" -#: forms.py:728 models.py:144 +#: forms.py:735 models.py:144 msgid "Excavation end date" msgstr "" -#: forms.py:731 models.py:145 +#: forms.py:738 models.py:145 msgid "Report delivery date" msgstr "" -#: forms.py:782 +#: forms.py:791 msgid "" "If you want to set an excavation end date you have to provide a start date." msgstr "" -#: forms.py:787 +#: forms.py:796 msgid "The excavation end date cannot be before the start date." msgstr "" -#: forms.py:802 +#: forms.py:813 #, python-format msgid "" "Operation code already exist for year: %(year)d - use a value bigger than " "%(last_val)d" msgstr "" -#: forms.py:806 +#: forms.py:817 msgid "Bad operation code" msgstr "" -#: forms.py:838 +#: forms.py:823 models.py:159 models.py:368 +msgid "Operation code" +msgstr "" + +#: forms.py:849 msgid "Preventive informations - excavation" msgstr "" -#: forms.py:839 models.py:171 +#: forms.py:850 models.py:171 #: templates/ishtar/dashboards/dashboard_operation.html:495 msgid "Cost (euros)" msgstr "" -#: forms.py:840 models.py:176 +#: forms.py:851 models.py:176 msgid "Scheduled man-days" msgstr "" -#: forms.py:842 models.py:179 +#: forms.py:853 models.py:179 msgid "Optional man-days" msgstr "" -#: forms.py:844 models.py:182 +#: forms.py:855 models.py:182 msgid "Effective man-days" msgstr "" -#: forms.py:854 +#: forms.py:865 msgid "Preventive informations - diagnostic" msgstr "" -#: forms.py:857 models.py:201 +#: forms.py:868 models.py:201 msgid "Prescription on zoning" msgstr "" -#: forms.py:859 models.py:204 +#: forms.py:870 models.py:204 msgid "Prescription on large area" msgstr "" -#: forms.py:862 models.py:206 +#: forms.py:873 models.py:206 msgid "Prescription on geoarchaeological context" msgstr "" -#: forms.py:866 forms.py:888 models.py:170 models.py:597 +#: forms.py:877 forms.py:899 models.py:170 models.py:599 msgid "Towns" msgstr "" -#: forms.py:895 models.py:779 models.py:936 +#: forms.py:906 models.py:781 models.py:938 msgid "Parcel" msgstr "" -#: forms.py:922 models.py:43 +#: forms.py:933 models.py:43 msgid "Remain types" msgstr "" -#: forms.py:926 models.py:42 +#: forms.py:937 models.py:42 msgid "Remain type" msgstr "" -#: forms.py:941 +#: forms.py:952 msgid "Period" msgstr "" -#: forms.py:952 models.py:76 +#: forms.py:963 models.py:76 msgid "Reference" msgstr "" -#: forms.py:977 +#: forms.py:988 msgid "This reference already exists." msgstr "" -#: forms.py:994 models.py:85 +#: forms.py:1005 models.py:85 msgid "Archaeological site" msgstr "" -#: forms.py:998 -msgid "Archaelogical site" -msgstr "" - -#: forms.py:1008 models.py:86 models.py:223 +#: forms.py:1020 models.py:86 models.py:223 #: templates/ishtar/sheet_operation.html:126 msgid "Archaeological sites" msgstr "" -#: forms.py:1012 +#: forms.py:1024 msgid "Associated archaelogical sites" msgstr "" -#: forms.py:1018 ishtar_menu.py:33 ishtar_menu.py:63 ishtar_menu.py:92 +#: forms.py:1030 ishtar_menu.py:33 ishtar_menu.py:63 ishtar_menu.py:92 msgid "Search" msgstr "" -#: forms.py:1023 +#: forms.py:1035 msgid "Would you like to close this operation?" msgstr "" -#: forms.py:1028 +#: forms.py:1040 msgid "Would you like to delete this operation?" msgstr "" -#: forms.py:1037 forms.py:1100 models.py:515 models.py:564 +#: forms.py:1049 forms.py:1112 models.py:517 models.py:566 msgid "Index" msgstr "" -#: forms.py:1063 +#: forms.py:1075 #, python-format msgid "" "Index already exists for operation: %(operation)s - use a value bigger than " "%(last_val)d" msgstr "" -#: forms.py:1075 +#: forms.py:1087 msgid "Operation's town" msgstr "" -#: forms.py:1078 +#: forms.py:1090 msgid "Operation's year" msgstr "" -#: forms.py:1089 +#: forms.py:1101 msgid "Documentation search" msgstr "" -#: forms.py:1091 +#: forms.py:1103 msgid "You should select a document." msgstr "" -#: forms.py:1106 forms.py:1172 models.py:539 models.py:558 +#: forms.py:1118 forms.py:1184 models.py:541 models.py:560 msgid "Act type" msgstr "" -#: forms.py:1107 forms.py:1260 +#: forms.py:1119 forms.py:1272 msgid "Indexed?" msgstr "" -#: forms.py:1113 forms.py:1177 models.py:588 +#: forms.py:1125 forms.py:1189 models.py:590 #: templates/ishtar/blocks/window_tables/administrativacts.html:8 msgid "Object" msgstr "" -#: forms.py:1149 views.py:373 +#: forms.py:1161 views.py:373 msgid "Administrative act search" msgstr "" -#: forms.py:1164 forms.py:1218 forms.py:1285 +#: forms.py:1176 forms.py:1230 forms.py:1297 msgid "You should select an administrative act." msgstr "" -#: forms.py:1180 models.py:585 +#: forms.py:1192 models.py:587 msgid "Signature date" msgstr "" -#: forms.py:1195 +#: forms.py:1207 msgid "Would you like to delete this administrative act?" msgstr "" -#: forms.py:1200 +#: forms.py:1212 msgid "Template" msgstr "" -#: forms.py:1224 forms.py:1228 +#: forms.py:1236 forms.py:1240 msgid "This document is not intended for this type of act." msgstr "" -#: forms.py:1246 +#: forms.py:1258 msgid "Doc generation" msgstr "" -#: forms.py:1248 +#: forms.py:1260 msgid "Generate the associated doc?" msgstr "" -#: forms.py:1269 ishtar_menu.py:121 views.py:407 +#: forms.py:1281 ishtar_menu.py:121 views.py:407 msgctxt "admin act register" msgid "Register" msgstr "" @@ -513,7 +514,7 @@ msgstr "" msgid "Deletion" msgstr "" -#: ishtar_menu.py:58 models.py:604 +#: ishtar_menu.py:58 models.py:606 #: templates/ishtar/sheet_administrativeact.html:6 msgid "Administrative act" msgstr "" @@ -547,11 +548,11 @@ msgstr "" msgid "Operations" msgstr "" -#: models.py:48 models.py:64 models.py:1400 +#: models.py:48 models.py:64 models.py:1402 msgid "Order" msgstr "" -#: models.py:50 models.py:939 +#: models.py:50 models.py:941 msgid "End date" msgstr "" @@ -615,7 +616,7 @@ msgstr "" msgid "In charge scientist" msgstr "" -#: models.py:163 models.py:763 +#: models.py:163 models.py:765 msgid "File" msgstr "" @@ -664,7 +665,7 @@ msgstr "" msgid "Intercommunal" msgstr "" -#: models.py:351 models.py:527 +#: models.py:351 models.py:529 msgid "Archaeological file" msgstr "" @@ -676,189 +677,189 @@ msgstr "" msgid "This operation code already exists for this year" msgstr "" -#: models.py:459 +#: models.py:461 msgid "Inverse relation" msgstr "" -#: models.py:463 +#: models.py:465 msgid "Operation relation type" msgstr "" -#: models.py:464 +#: models.py:466 msgid "Operation relation types" msgstr "" -#: models.py:477 +#: models.py:479 msgid "Operation record relation" msgstr "" -#: models.py:478 +#: models.py:480 msgid "Operation record relations" msgstr "" -#: models.py:499 +#: models.py:501 msgid "Operation documentation" msgstr "" -#: models.py:500 +#: models.py:502 msgid "Operation documentations" msgstr "" -#: models.py:503 +#: models.py:505 msgid "Can view all Operation sources" msgstr "" -#: models.py:505 +#: models.py:507 msgid "Can view own Operation source" msgstr "" -#: models.py:507 +#: models.py:509 msgid "Can add own Operation source" msgstr "" -#: models.py:509 +#: models.py:511 msgid "Can change own Operation source" msgstr "" -#: models.py:511 +#: models.py:513 msgid "Can delete own Operation source" msgstr "" -#: models.py:530 +#: models.py:532 msgid "Intended to" msgstr "" -#: models.py:532 +#: models.py:534 msgid "Code" msgstr "" -#: models.py:535 +#: models.py:537 msgid "Associated template" msgstr "" -#: models.py:536 +#: models.py:538 msgid "Indexed" msgstr "" -#: models.py:540 +#: models.py:542 msgid "Act types" msgstr "" -#: models.py:562 +#: models.py:564 msgid "Person in charge of the operation" msgstr "" -#: models.py:568 +#: models.py:570 msgid "Archaeological preventive operator" msgstr "" -#: models.py:576 +#: models.py:578 msgid "Signatory" msgstr "" -#: models.py:594 +#: models.py:596 msgid "Departments" msgstr "" -#: models.py:595 +#: models.py:597 msgid "Cached values get from associated departments" msgstr "" -#: models.py:598 +#: models.py:600 msgid "Cached values get from associated towns" msgstr "" -#: models.py:605 templates/ishtar/sheet_operation.html:134 +#: models.py:607 templates/ishtar/sheet_operation.html:134 msgid "Administrative acts" msgstr "" -#: models.py:608 +#: models.py:610 msgid "Can view all Administrative acts" msgstr "" -#: models.py:610 +#: models.py:612 msgid "Can view own Administrative act" msgstr "" -#: models.py:612 +#: models.py:614 msgid "Can add own Administrative act" msgstr "" -#: models.py:614 +#: models.py:616 msgid "Can change own Administrative act" msgstr "" -#: models.py:616 +#: models.py:618 msgid "Can delete own Administrative act" msgstr "" -#: models.py:625 +#: models.py:627 #: templates/ishtar/blocks/window_tables/administrativacts.html:5 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:5 msgid "Ref." msgstr "" -#: models.py:708 +#: models.py:710 msgid "This index already exists for this year" msgstr "" -#: models.py:774 +#: models.py:776 msgid "External ID" msgstr "" -#: models.py:776 +#: models.py:778 msgid "Address - Locality" msgstr "" -#: models.py:934 +#: models.py:936 msgid "Owner" msgstr "" -#: models.py:942 +#: models.py:944 msgid "Parcel owner" msgstr "" -#: models.py:943 +#: models.py:945 msgid "Parcel owners" msgstr "" -#: models.py:969 +#: models.py:971 msgid "Recorded" msgstr "" -#: models.py:970 +#: models.py:972 msgid "Effective" msgstr "" -#: models.py:971 +#: models.py:973 msgid "Active" msgstr "" -#: models.py:972 +#: models.py:974 msgid "Field completed" msgstr "" -#: models.py:973 +#: models.py:975 msgid "Associated report" msgstr "" -#: models.py:974 +#: models.py:976 msgid "Closed" msgstr "" -#: models.py:975 +#: models.py:977 msgid "Documented and closed" msgstr "" -#: models.py:1401 +#: models.py:1403 msgid "Is preventive" msgstr "" -#: models.py:1404 +#: models.py:1406 msgid "Operation type old" msgstr "" -#: models.py:1405 +#: models.py:1407 msgid "Operation types old" msgstr "" @@ -1110,10 +1111,18 @@ msgstr "" msgid "Context records" msgstr "" -#: templates/ishtar/sheet_operation.html:155 +#: templates/ishtar/sheet_operation.html:148 +msgid "Documents from associated context records" +msgstr "" + +#: templates/ishtar/sheet_operation.html:153 msgid "Finds" msgstr "" +#: templates/ishtar/sheet_operation.html:158 +msgid "Documents from associated finds" +msgstr "" + #: templates/ishtar/sheet_operationsource.html:6 msgid "Operation source" msgstr "" diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 945af21a4..d0a010d6a 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -427,6 +427,8 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem, # put a default year if start_date is defined if self.start_date and not self.year: self.year = self.start_date.year + if self.operation_code is None: + self.operation_code = self.get_available_operation_code(self.year) return super(Operation, self).save(*args, **kwargs) m2m_changed.connect(cached_label_changed, sender=Operation.towns.through) diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 14210046b..d1cd1578c 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -145,21 +145,19 @@ {% dynamic_table_document context_records 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %} {% endif %} -{% comment %} {% trans "Documents from associated context records" as cr_docs %} {% if item.context_record_docs_q.count %} {% dynamic_table_document cr_docs 'context_records_docs' 'context_record__operation' item.pk '' output %} {% endif %} -{% endcomment %} {% trans "Finds" as finds %} {% if item.finds %} {% dynamic_table_document finds 'finds_for_ope' 'base_finds__context_record__operation' item.pk 'TABLE_COLS_FOR_OPE' output %} {% endif %} -{% comment %} -{% trans "Documents from associated finds" as find_docs %} -{% if item.find_docs_q.count %} {% table_document find_docs item.find_docs_q.all %}{% endif %} -{% endcomment %} +{% trans "Documents from associated finds" as finds_docs %} +{% if item.find_docs_q.count %} +{% dynamic_table_document finds_docs 'finds_docs' 'find__base_finds__context_record__operation' item.pk '' output %} +{% endif %} {% endblock %} |
