misc: get first existing oldest form in mass action (#88849) #1334
|
@ -4513,11 +4513,10 @@ class MassActionAfterJob(AfterJob):
|
|||
# action not found
|
||||
return
|
||||
|
||||
if item_ids:
|
||||
oldest_lazy_form = formdef.data_class().get(item_ids[0]).get_as_lazy()
|
||||
self.total_count = len(item_ids)
|
||||
self.store()
|
||||
|
||||
oldest_lazy_form = None
|
||||
publisher = get_publisher()
|
||||
for i, formdata_id in enumerate(item_ids):
|
||||
# do not load all formdatas at once as they can be modified during the loop
|
||||
|
@ -4525,6 +4524,8 @@ class MassActionAfterJob(AfterJob):
|
|||
formdata = formdef.data_class().get(formdata_id, ignore_errors=True)
|
||||
if not formdata:
|
||||
continue
|
||||
if oldest_lazy_form is None:
|
||||
oldest_lazy_form = formdata.get_as_lazy()
|
||||
publisher.reset_formdata_state()
|
||||
publisher.substitutions.feed(user)
|
||||
publisher.substitutions.feed(formdef)
|
||||
|
|
Loading…
Reference in New Issue