summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-19 10:17:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-28 11:40:17 +0100
commiteb9d989822c4314bb36d2b8179a598c8b9f2b9c9 (patch)
tree9419d2afb458f94c36c5e7434ba5c2625e37f45a /archaeological_finds/models_treatments.py
parent01b5bc5bd7e053fdfc160d3ecc8b105ca5bd5691 (diff)
downloadIshtar-eb9d989822c4314bb36d2b8179a598c8b9f2b9c9.tar.bz2
Ishtar-eb9d989822c4314bb36d2b8179a598c8b9f2b9c9.zip
Treatment n<->1: copy and merge data
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index c7b888c0d..d92c98235 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -34,7 +34,8 @@ from ishtar_common.models import Document, GeneralType, \
ImageModel, BaseHistorizedItem, OwnPerms, HistoricalRecords, Person, \
Organization, ValueGetter, post_save_cache, ShortMenuItem, \
DashboardFormItem, ExternalIdManager
-from ishtar_common.utils import cached_label_changed, get_current_year
+from ishtar_common.utils import cached_label_changed, get_current_year, \
+ update_data
class TreatmentState(GeneralType):
@@ -351,6 +352,10 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,
current_documents.append(document.pk)
new_find.documents.add(document)
+ # data
+ new_find.data = update_data(new_find.data, upstream_item.data,
+ merge=True)
+
upstream_item.downstream_treatment = self
upstream_item.history_modifier = self.history_modifier
upstream_item.save()