diff options
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' |