summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-27 17:20:43 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-27 17:20:43 +0200
commit3d766fae8dd27b097eadd66993a091aa32af1aec (patch)
tree9201a1616398d4145fe3836821c3ccca788d817d /archaeological_warehouse/wizards.py
parent7186a3adae39105729e31d0c7b594fcbcbdfd091 (diff)
downloadIshtar-3d766fae8dd27b097eadd66993a091aa32af1aec.tar.bz2
Ishtar-3d766fae8dd27b097eadd66993a091aa32af1aec.zip
Warehouse: link warehouse to an organization - manage address dependencies
Diffstat (limited to 'archaeological_warehouse/wizards.py')
-rw-r--r--archaeological_warehouse/wizards.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/archaeological_warehouse/wizards.py b/archaeological_warehouse/wizards.py
index 3d762ceb6..7476eb2b7 100644
--- a/archaeological_warehouse/wizards.py
+++ b/archaeological_warehouse/wizards.py
@@ -76,6 +76,19 @@ class WarehouseWizard(Wizard):
model = models.Warehouse
wizard_done_window = reverse_lazy('show-warehouse')
+ def save_model(self, dct, m2m, whole_associated_models, form_list,
+ return_object):
+ create_organization = False
+ if 'create_organization' in dct:
+ create_organization = dct.pop('create_organization')
+ obj, res = super(WarehouseWizard, self).save_model(
+ dct, m2m, whole_associated_models, form_list, True
+ )
+ if self.modification or not create_organization:
+ return return_object and (obj, res) or res
+ obj.create_attached_organization()
+ return return_object and (obj, res) or res
+
class WarehouseModificationWizard(Wizard):
model = models.Warehouse