diff options
-rw-r--r-- | CHANGES.md | 3 | ||||
-rw-r--r-- | ishtar_common/forms_common.py | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/CHANGES.md b/CHANGES.md index 14ebfc6bb..16c5c7cb0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,8 @@ v3.0.4 - 2020-XX-XX ### Features ### - Quick actions - sheets: add duplicate for site, operation, document and context record - Quick actions - tables: - - finds: edit - add appraisal date and treatment emergency fields + - find: edit - add appraisal date and treatment emergency fields + - person: edit - add organization field v3.0.3 - 2020-02-24 ------------------- diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 31eb5c7d2..2b3227f0a 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -575,20 +575,37 @@ class QAPersonFormMulti(QAForm): base_models = ['qa_title'] associated_models = { 'qa_title': models.TitleType, + 'qa_attached_to': models.Organization, } MULTI = True REPLACE_FIELDS = [ 'qa_title', + 'qa_attached_to' ] qa_title = forms.ChoiceField( label=_(u"Title"), required=False ) + qa_attached_to = forms.IntegerField( + label=_("Organization"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-organization'), + associated_model=models.Organization), + validators=[models.valid_id(models.Organization)], + required=False + ) TYPES = [ FieldType('qa_title', models.TitleType), ] + def _get_qa_attached_to(self, value): + try: + value = models.Organization.objects.get(pk=value).cached_label + except models.Organization.DoesNotExist: + return "" + return value + class PersonMergeFormSelection(ManualMerge, forms.Form): SEARCH_AND_SELECT = True |