← Back to team overview

openerp-community team mailing list archive

Workflow: trigger_model and trigger_expr_id

 

Good morning,

Question Of The Day:

I've got a workflow for my rent orders, and I would like to confirm a transition if all invoices are removed/paid/anything.

I did this:

<record id="ongoing_to_confirmed" model="workflow.transition">
            <field name="act_from" ref="state_ongoing" />
            <field name="act_to" ref="state_confirmed" />
            <field name="condition">not test_have_invoices()</field>
            <field name="trigger_model">account.invoice</field>
            <field name="trigger_expr_id">get_orders_invoices_ids()</field>
</record>

It seems the work, my method get_orders_invoices_ids() returns the invoices IDs associated to my orders, test_have_invoices() returns True if the order have nay invoices attached to it.

My problem is that the test is called only once. Later, when I edit/remove my invoice, nothing is called. So, I would like to be sure I understood what trigger_model and trigger_expr_id does.

Thanks,

--
Thibaut DIRLIK