diff options
-rw-r--r-- | archaeological_files_pdl/forms.py | 6 | ||||
-rw-r--r-- | archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js | 1 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/organization_form.html | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py index 659d22d68..d17797a0b 100644 --- a/archaeological_files_pdl/forms.py +++ b/archaeological_files_pdl/forms.py @@ -253,13 +253,15 @@ class FileFormPlanningService(forms.Form): planning_service = forms.IntegerField( label=_("Planning service"), required=False, - widget=widgets.JQueryAutoComplete( + widget=widgets.JQueryPersonOrganization( reverse_lazy('autocomplete-organization', args=[RESPONSIBLE_PLANNING_SERVICE_ORGA.pk]), + reverse_lazy('organization_create'), + model=models.Organization, limit={ 'organization_type': [RESPONSIBLE_PLANNING_SERVICE_ORGA.pk] }, - associated_model=models.Organization, + js_template='ishtar/blocks/JQueryCorporationPerson.js', new=True), validators=[valid_id(models.Organization)] ) diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js index be1faabfe..4a3943d3c 100644 --- a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js +++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js @@ -39,6 +39,7 @@ $(function() { if(ui.item){ url = {{edit_source}}+ui.item.id; $('#id_{{field_id}}').val(ui.item.id); + $('#id_{{field_id}}').change(); } else { $('#id_{{field_id}}').val(null); } diff --git a/ishtar_common/templates/ishtar/organization_form.html b/ishtar_common/templates/ishtar/organization_form.html index 3a2d37846..28415ab88 100644 --- a/ishtar_common/templates/ishtar/organization_form.html +++ b/ishtar_common/templates/ishtar/organization_form.html @@ -67,6 +67,7 @@ person_save_callback = function(){ $( "#div-"+parent_id ).html( data ); var lbl = $('#hidden_organization_lbl').val(); $('#id_select_' + parent_id).val(lbl); + $('#id_' +parent_id).change(); }); }; |