Add an "Update Status" button to the Peppol document

This commit is contained in:
Cédric Krier
2026-01-15 10:35:05 +01:00
parent f7f8c002b7
commit 14c2a4435c
5 changed files with 16 additions and 5 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add an "Update Status" button to the Peppol document
Version 7.8.0 - 2025-12-15
--------------------------
+7
View File
@@ -146,6 +146,12 @@ class Peppol(Workflow, ModelSQL, ModelView):
'invisible': ~Eval('state').in_(['submitted', 'processing']),
'depends': ['state'],
},
update_status={
'invisible': (
(Eval('state') != 'processing')
| (Eval('direction') != 'out')),
'depends': ['state', 'direction'],
},
retry={
'invisible': Eval('state') != 'failed',
'depends': ['state'],
@@ -230,6 +236,7 @@ class Peppol(Workflow, ModelSQL, ModelView):
self.succeed()
@classmethod
@ModelView.button
def update_status(cls, documents=None):
if documents is None:
documents = cls.search([
+6
View File
@@ -138,6 +138,12 @@ this repository contains the full copyright notices and license terms. -->
<field name="string">Process</field>
</record>
<record model="ir.model.button" id="edocument_peppol_update_status_button">
<field name="model">edocument.peppol</field>
<field name="name">update_status</field>
<field name="string">Update Status</field>
</record>
<record model="ir.model.button" id="edocument_peppol_retry_button">
<field name="model">edocument.peppol</field>
<field name="name">retry</field>
@@ -35,6 +35,7 @@ this repository contains the full copyright notices and license terms. -->
<button name="draft" icon="tryton-back"/>
<button name="submit" icon="tryton-forward"/>
<button name="process"/>
<button name="update_status"/>
<button name="retry" icon="tryton-launch"/>
</group>
</form>