Project

General

Profile

Bug #43243

changement de workflow d'un formulaire : appliquer le mapping des status aux marqueurs

Added by Thomas Noël about 2 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
24 May 2020
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Lors d'un changement de workflow dans workflow_status_remapping_submit (admin/forms.py) on adapte les statuts des formdata et de leur évolution :

     def workflow_status_remapping_submit(self, form):
            ...
            # if there are status changes, update all formdatas
            ...
            for item in self.formdef.data_class().select():
                item.status = status_mapping.get(item.status)
                if item.evolution:
                    for evo in item.evolution:
                        evo.status = status_mapping.get(evo.status)
                item.store()

On a oublié ici d'adapter aussi formdata.workflow_data['_markers_stack']

Also available in: Atom PDF