[FIX] account: fix unexpected invalidation of field account_invoice.reconciled
authorRaphael Collet <rco@openerp.com>
Tue, 5 Aug 2014 08:01:07 +0000 (10:01 +0200)
committerRaphael Collet <rco@openerp.com>
Tue, 5 Aug 2014 08:01:07 +0000 (10:01 +0200)
commitc0997d332adf78eb42fc3a1a1280dfa25889e7d5
treecc895d09b9a1eb8d3ac7222c227e7edab2b328a2
parentdbca34511e141144ac6add55400ef529bdfa07b1
[FIX] account: fix unexpected invalidation of field account_invoice.reconciled

Problem: the field account_invoice.reconciled was invalidated by a workflow
signal sent from the compute method of the field. The purpose of the signal was
to re-open the invoice when the account move lines were no longer reconciled,
for instance after cancelling a reconciliation.

Solution: modify the workflow such that it makes an automatic transition from
'paid' to 're-open' when the condition 'not reconciled' is met. This works
because the field 'reconciled' is stored, and each recomputation forces a
reevaluation the workflow. The signal to re-open the invoice is thus no longer
necessary.
addons/account/account_invoice.py
addons/account/account_invoice_workflow.xml