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 | bb2d0bd69d32717e69fd6a4dcc524cb89f8c38a4 (patch) | |
tree | be0552b8eaaefbce6d4094343634f245f3cc4f55 /archaeological_finds/models_treatments.py | |
parent | 1a451903577cbdc90a6a84a7033147e07c7e0c6c (diff) | |
download | Ishtar-bb2d0bd69d32717e69fd6a4dcc524cb89f8c38a4.tar.bz2 Ishtar-bb2d0bd69d32717e69fd6a4dcc524cb89f8c38a4.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' |