[7.0]Cancelling a bank statement does not set voucher to state draft

Bug #1149116 reported by Niels Huylebroeck
4
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team

Bug Description

If you look at the code here you can see the state of the bank statement is set to draft when cancelled .
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account/account_bank_statement.py#L448

However each of the bank statement lines has an account.voucher linked to it which is set to state 'cancel' the result is that the user cannot alter any of the reconciliation on the bank statement.

The preferred solution would be to reset the vouchers to the state 'draft' whenever the related bank statement is also set to draft.

This is a bug that was not present in the 6.0/6.1 branches because you were unable to cancel a bank statement when any of the generated moves was reconciled, obviously it's a good improvement in v7.0 to allow cancelling but since the way the vouchers (for reconciling) are created was changed (also in v7.0) you can not just create a new voucher as you would have done in v6.x

Tags: maintenance

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Niels,

This is because of the current behaviour in OpenERP in stable 7, What actually happen is when you cancel the Bank statement its related voucher's state also set as cancel and a button visible on the voucher as "Set as Draft" (if need to change the state manually). So from the current behaviour you can use button "Set as Draft" to change the state of the voucher as "Draft".

As this is a normal behaviour so here we will not consider this as a bug because this is neither a blocking issue nor a real bug but can be consider as a usability improvement for the future version of OpenERP, This is why I am setting the state of this bug as wishlist so that R&D will decide the behaviour of state on voucher when Bank statement is cancelled.

Changed in openobject-addons:
importance: Medium → Wishlist
summary: - Cancelling a bank statement does not set voucher to state draft
+ [7.0]Cancelling a bank statement does not set voucher to state draft
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Niels,

As per discussion with our experts I have fixed the issue for "Cancelling a bank statement does not set voucher to state draft" into the lp:~openerp-dev/openobject-addons/7.0-587621-opw-skh branch with the following details,

Revision ID: <email address hidden>
Revision Number:8908

This branch is under the review of our experts and will be merged soon into stable 7 addons once it approved.

Thanks & Regards,
Somesh Khare

Changed in openobject-addons:
status: Confirmed → In Progress
importance: Wishlist → Low
status: In Progress → Fix Committed
Revision history for this message
Niels Huylebroeck (red15) wrote :

Thank you Somesh,

The patch worked but I found that it would leave draft vouchers laying around if you change the amount after cancelling the bank statement.

I've provided another small (but well commented) patch which should help you understand where the problem is coming from.

Revision history for this message
Niels Huylebroeck (red15) wrote : Re: [Bug 1149116] Re: [7.0]Cancelling a bank statement does not set voucher to state draft

Somesh,

Have you consulted my proposed changes which I've requested to be merged
into your proposed fix ?

Please look here
https://code.launchpad.net/~openerp-community/openobject-addons/7.0-587621-opw-orphan-voucher/+merge/154932

Regards,
Niels

2013/3/22 Niels Huylebroeck <email address hidden>

> Thank you Somesh,
>
> The patch worked but I found that it would leave draft vouchers laying
> around if you change the amount after cancelling the bank statement.
>
> I've provided another small (but well commented) patch which should help
> you understand where the problem is coming from.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1149116
>
> Title:
> [7.0]Cancelling a bank statement does not set voucher to state draft
>
> Status in OpenERP Addons (modules):
> Fix Committed
>
> Bug description:
> If you look at the code here you can see the state of the bank statement
> is set to draft when cancelled .
>
> http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account/account_bank_statement.py#L448
>
> However each of the bank statement lines has an account.voucher linked
> to it which is set to state 'cancel' the result is that the user
> cannot alter any of the reconciliation on the bank statement.
>
> The preferred solution would be to reset the vouchers to the state
> 'draft' whenever the related bank statement is also set to draft.
>
> This is a bug that was not present in the 6.0/6.1 branches because you
> were unable to cancel a bank statement when any of the generated moves
> was reconciled, obviously it's a good improvement in v7.0 to allow
> cancelling but since the way the vouchers (for reconciling) are
> created was changed (also in v7.0) you can not just create a new
> voucher as you would have done in v6.x
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/1149116/+subscriptions
>

--
Niels Huylebroeck
Bubbles-IT
Tel. : +32 (0)9 328 33 88
Web : http://www.bubbles-it.be

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Somesh and 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,
Naresh Soni,
OpenERP Enterprise Services

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.