Set button decorator of update Peppol status to a different method than the cron

The `ModelView.button` decorator requires to be called with a list of records
which the cron does not do.

Closes #14972
(grafted from d3bdcee315895e3fc4a636c14dad5ba592912c59)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-07-28 19:23:07 +02:00
parent 86e58a889e
commit 234ca3f7fd
+5 -1
View File
@@ -239,13 +239,17 @@ class Peppol(Workflow, ModelSQL, ModelView):
self.succeed()
@classmethod
@ModelView.button
def update_status(cls, documents=None):
if documents is None:
documents = cls.search([
('direction', '=', 'out'),
('state', '=', 'processing'),
])
cls.update_status_button(documents)
@classmethod
@ModelView.button
def update_status_button(cls, documents):
for document in documents:
document._update_status()
cls.save(documents)