Change of workflow activity when the object is modified

Asked by Vincent Le Goff

I need to build a workflow, bound to one OSV object (a sale order). The workflow should automatically change its activity when the object is modified.

For instance, when the order is considered as 'paid' (the order ammount is equal to the sum of the payments for this order), the workflow activity should change from 'open' to 'paid'.

Obviously this is possible using the workflow system. A transition between the 'open' activity and 'paid' activity has no signal, only a condition:

<field name="condition">paid()</field>

'paid' is a method of the 'oder' object, which returns True or False whether the order is paid.

However, the condition doesn't seem to be tested. I tried to write in the order object (passing to the 'write' method an empty dictionary) but the order stay in its 'open' activity.

How could I perform this automatic check?

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Vincent Le Goff
Solved:
Last query:
Last reply:
Revision history for this message
Lorenzo Battistini (elbati) said :
#1

Take a look at the the invoice's workflow, it does exactly what you need

Revision history for this message
Vincent Le Goff (vincent-le-goff) said :
#2

We checked it out before we tried. The transitions weren't executed because they both needed signals before. I deleted the signal field but it still remained in the database. After deleting them from the database, there wasn't any problem and it actualy works as it should.