details:   https://code.tryton.org/tryton/commit/0500ed4bcc01
branch:    8.0
user:      Cédric Krier <[email protected]>
date:      Tue Jul 28 19:23:07 2026 +0200
description:
        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)
diffstat:

 modules/edocument_peppol/edocument.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 19c30f11ed19 -r 0500ed4bcc01 modules/edocument_peppol/edocument.py
--- a/modules/edocument_peppol/edocument.py     Mon Jul 27 10:39:01 2026 +0200
+++ b/modules/edocument_peppol/edocument.py     Tue Jul 28 19:23:07 2026 +0200
@@ -239,13 +239,17 @@
                 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)

Reply via email to