diff options
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 |
commit | 5d4a7912d085a4af2491e8b413a552f598c943c2 (patch) | |
tree | 9201a1616398d4145fe3836821c3ccca788d817d /archaeological_warehouse/wizards.py | |
parent | de5b617a9b575911f09695028b5b650c53dcd6f6 (diff) | |
download | Ishtar-5d4a7912d085a4af2491e8b413a552f598c943c2.tar.bz2 Ishtar-5d4a7912d085a4af2491e8b413a552f598c943c2.zip |
Warehouse: link warehouse to an organization - manage address dependencies
Diffstat (limited to 'archaeological_warehouse/wizards.py')
-rw-r--r-- | archaeological_warehouse/wizards.py | 13 |
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 |