Merge lp:~openerp-community/openobject-addons/7.0-587621-opw-orphan-voucher into lp:~openerp-dev/openobject-addons/7.0-587621-opw-skh

Proposed by Niels Huylebroeck
Status: Needs review
Proposed branch: lp:~openerp-community/openobject-addons/7.0-587621-opw-orphan-voucher
Merge into: lp:~openerp-dev/openobject-addons/7.0-587621-opw-skh
Diff against target: 18 lines (+8/-0)
1 file modified
account_voucher/ (+8/-0)
To merge this branch: bzr merge lp:~openerp-community/openobject-addons/7.0-587621-opw-orphan-voucher
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Needs Information
Somesh Khare Pending
Review via email:

Description of the change

Instead of simply unhooking any draft vouchers from the bank.statement.line we clean them up when you change the amount of the bank.statement.line.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Niels,

Well, this does not seem to be an issue that needs an OPW cover to get in to stable, rather it seems an improvement. Secondly, according to the current stable source the related vouchers are set to cancelled state when you cancel the bank statement and later if you confirm the bank statement again the same voucher will be in posted state. Which is so far good.

Now comes your case(@Niels) for which you have proposed a merge proposal where in you unlink the isolated vouchers that are result of changing the original amount on the bank statement line. But here if you look closely as soon as you change the original amount on the bank statement line the button on the line will turn *red* if the balance does not match that means you need to take care you are reconciling it with the correct amount. To Fix this you need to click on the button to and change the *Allocation* value to the actual value you want to reconcile. As soon as you correct that you see the button turns *Green* means everything is correctly setup and now you can proceed with reconciliation. In this case the previous voucher will be in cancelled state and a new entry will be created and reconciled(posted).

Keeping the history of vouchers (altered ones) seems good. instead of setting them to draft and later unlinking them.

However, we its still open to be discussed.


review: Needs Information

Unmerged revisions

8909. By Niels Huylebroeck

[IMP] account_voucher: cleaning up the orphan voucher when changing the amount on the bank.statement.line

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_voucher/'
2--- account_voucher/ 2013-03-21 13:38:48 +0000
3+++ account_voucher/ 2013-03-22 12:20:26 +0000
4@@ -1561,6 +1561,14 @@
5 return res
7 def onchange_amount(self, cr, uid, ids, amount, context=None):
8+ # If the line already has a voucher_id and the state of it is 'draft'
9+ # it means this bank statement was cancelled before and we should delete
10+ # the voucher AND clear the field voucher_id.
11+ if ids:
12+ for line in self.browse(cr, uid, ids, context=context):
13+ if line.voucher_id and line.voucher_id.state == 'draft':
14+ # Instead of orphaning this draft voucher, we will delete it
15+ line.voucher_id.unlink()
16 return {'value' : {'voucher_id' : False}}
18 def _amount_reconciled(self, cursor, user, ids, name, args, context=None):


People subscribed via source and target branches