diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-10 16:55:17 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-10 16:55:17 +0100 |
commit | 9227051e8bdbbae75064da3e537aba499a794289 (patch) | |
tree | be0552b8eaaefbce6d4094343634f245f3cc4f55 /archaeological_finds/models_treatments.py | |
parent | 4f7ee53df30339980ac0ed38a3a2af17a84c34e2 (diff) | |
download | Ishtar-9227051e8bdbbae75064da3e537aba499a794289.tar.bz2 Ishtar-9227051e8bdbbae75064da3e537aba499a794289.zip |
Treatments: manage loan, loan return and packaging by parameters
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 3d3827596..ee4fde0f0 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -477,7 +477,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, # manage loan return for tp in treatment_types: - if tp.txt_idx == 'loan-return': + if tp.restore_reference_location: for find in q.all(): if find.container_ref: find.container = find.container_ref @@ -485,6 +485,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, # don't record twice history find.skip_history_when_saving = True find.save() + break # manage containers if not self.container: @@ -492,13 +493,13 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, container_attr = None for tp in treatment_types: - if tp.txt_idx == 'loan': - if container_attr: + if tp.change_current_location: + if container_attr == 'container_ref': # non consistent treatment return container_attr = 'container' - if tp.txt_idx == 'packaging': - if container_attr: + if tp.change_reference_location: + if container_attr == 'container': # non consistent treatment return container_attr = 'container_ref' |