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/account_voucher.py (+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: mp+154932@code.launchpad.net

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 https://code.launchpad.net/~openerp-community/openobject-addons/7.0-587621-opw-orphan-voucher/+merge/154932 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.

Thanks,

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
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2013-03-21 13:38:48 +0000
+++ account_voucher/account_voucher.py 2013-03-22 12:20:26 +0000
@@ -1561,6 +1561,14 @@
1561 return res1561 return res
15621562
1563 def onchange_amount(self, cr, uid, ids, amount, context=None):1563 def onchange_amount(self, cr, uid, ids, amount, context=None):
1564 # If the line already has a voucher_id and the state of it is 'draft'
1565 # it means this bank statement was cancelled before and we should delete
1566 # the voucher AND clear the field voucher_id.
1567 if ids:
1568 for line in self.browse(cr, uid, ids, context=context):
1569 if line.voucher_id and line.voucher_id.state == 'draft':
1570 # Instead of orphaning this draft voucher, we will delete it
1571 line.voucher_id.unlink()
1564 return {'value' : {'voucher_id' : False}}1572 return {'value' : {'voucher_id' : False}}
15651573
1566 def _amount_reconciled(self, cursor, user, ids, name, args, context=None):1574 def _amount_reconciled(self, cursor, user, ids, name, args, context=None):

Subscribers

People subscribed via source and target branches