general: update file types in all kind of formdefs on change (#47180) #688
Loading…
Reference in New Issue
No description provided.
Delete Branch "wip/47180-update-filetype-in-all-formdefs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: general: update file types in all kind of formdefs on change (#47180)to general: update file types in all kind of formdefs on change (#47180)@ -447,0 +447,4 @@
return redirect('./')
job = get_response().add_after_job(
FileTypeUpdateAfterJob(
Au-delà de ce que je notais dans le ticket, je transforme ici en afterjob.
@ -1312,0 +1342,4 @@
filetype_id = self.kwargs['filetype_id']
previous_filetype = self.kwargs['previous_filetype']
new_filetype = self.kwargs['new_filetype']
for formdef in get_formdefs_of_all_kinds():
ce que ne demandait pas non plus le ticket : passer sur tous les types de formdef.
general: update file types in all kind of formdefs on change (#47180)to WIP: general: update file types in all kind of formdefs on change (#47180)177ee88e62
to056a3484a1
@ -1312,0 +1364,4 @@
for workflow in workflows:
changed = False
for item in workflow.get_all_items():
if item.key == 'addattachment':
Enfin ce que demandait le ticket : passer sur l'action "attacher un fichier".
WIP: general: update file types in all kind of formdefs on change (#47180)to general: update file types in all kind of formdefs on change (#47180)Demande un peu pénible d'ajouts de tests... peut être contestée !
@ -790,0 +801,4 @@
attach.document_type = formdef.fields[0].document_type
attach.by = ['_submitter']
wf.store()
Puisqu'on passe par get_formdefs_of_all_kinds pour mettre à jour les formdef, peut-être ajouter un bloc de champ avec un champ fichier, et une action de formulaire-de-workflow avec un champ fichier... (je sais, c'est un peu relou)
Voilà avec bloc et formulaire de workflow. (et bien d'avoir ajouté ce test, ça a permis de voir que la modif aux workflows pouvait ne pas avoir lieu s'il y avait à la fois formulaire de workflow et action de fichier attaché).
056a3484a1
to3df29ff9fc