[FIX] account_voucher: evaluate move line account with correct precision
authorMartin Trigaux <mat@openerp.com>
Fri, 2 Aug 2013 12:03:11 +0000 (14:03 +0200)
committerMartin Trigaux <mat@openerp.com>
Fri, 2 Aug 2013 12:03:11 +0000 (14:03 +0200)
commit44f7a82281ccdee2dab7f91c9bc2df3c54e2b7f1
tree652f9845db7e39db157fa8fb12edfa8b08afa8ae
parent110e74f46f24c768267256d1dc2eedb854fa91db
[FIX] account_voucher: evaluate move line account with correct precision

This bug may have generated incorrect account_voucher_line when validating a voucher with amount less than 1. This patch will avoid reproducing the problem on new lines but not fix already existing vouchers. To do so apply the following steps:

1. apply this patch
2. do a manual reconciliation of the account.move.lines with amount less than 1 (use the manual reconciliation menu to see every line, included 0-0 lines)
3. execute the following SQL query

DELETE FROM account_voucher_line WHERE id IN (SELECT l.id FROM account_voucher_line AS l JOIN account_voucher AS v ON (v.id = l.voucher_id) JOIN account_move_line AS ml ON (l.move_line_id = ml.id) WHERE l.amount = 0 AND v.state = 'draft' AND ml.debit = ml.credit AND ml.credit = 0);

that will remove account voucher lines from draft vouchers linked to an empty move lines

bzr revid: mat@openerp.com-20130802120311-oh64d47t8x6t1wf9
addons/account_voucher/account_voucher.py