Add an "Update Status" button to the Peppol document
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add an "Update Status" button to the Peppol document
|
||||
|
||||
Version 7.8.0 - 2025-12-15
|
||||
--------------------------
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -67,12 +67,8 @@ Send out a Peppol document::
|
||||
|
||||
Check Peppol status::
|
||||
|
||||
>>> cron, = Cron.find([
|
||||
... ('method', '=', 'edocument.peppol|update_status'),
|
||||
... ], limit=1)
|
||||
>>> while peppol.state == 'processing':
|
||||
... cron.click('run_once')
|
||||
... peppol.reload()
|
||||
... peppol.click('update_status')
|
||||
>>> peppol.state
|
||||
'succeeded'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user