Merge lp://staging/~camptocamp/banking-addons/bank-statement-reconcile-7.0-add-cancel-line-lep into lp://staging/banking-addons/bank-statement-reconcile-70

Proposed by Leonardo Pistone
Status: Merged
Merged at revision: 158
Proposed branch: lp://staging/~camptocamp/banking-addons/bank-statement-reconcile-7.0-add-cancel-line-lep
Merge into: lp://staging/banking-addons/bank-statement-reconcile-70
Diff against target: 1235 lines (+1139/-0)
18 files modified
account_statement_cancel_line/__init__.py (+25/-0)
account_statement_cancel_line/__openerp__.py (+74/-0)
account_statement_cancel_line/i18n/account_statement_cancel_line.pot (+97/-0)
account_statement_cancel_line/i18n/fr.po (+97/-0)
account_statement_cancel_line/migrations/0.3/post-set-statement-line-state.py (+38/-0)
account_statement_cancel_line/statement.py (+118/-0)
account_statement_cancel_line/statement_line.py (+213/-0)
account_statement_cancel_line/statement_view.xml (+28/-0)
account_statement_cancel_line/test/cancel_line.yml (+80/-0)
account_statement_cancel_line/test/confirm_statement_no_double_moves.yml (+70/-0)
account_statement_cancel_line/test/test_confirm_last_line_balance_check.yml (+42/-0)
account_statement_cancel_line/test/test_confirm_last_line_no_balance_check.yml (+44/-0)
account_statement_cancel_line/wizard/__init__.py (+24/-0)
account_statement_cancel_line/wizard/cancel_line.py (+46/-0)
account_statement_cancel_line/wizard/cancel_statement.py (+51/-0)
account_statement_cancel_line/wizard/cancel_statement_line.py (+46/-0)
account_statement_cancel_line/wizard/cancel_statement_line_view.xml (+22/-0)
account_statement_cancel_line/wizard/cancel_statement_view.xml (+24/-0)
To merge this branch: bzr merge lp://staging/~camptocamp/banking-addons/bank-statement-reconcile-7.0-add-cancel-line-lep
Reviewer Review Type Date Requested Status
Frederic Clementi - Camptocamp functional Approve
Nicolas Bessi - Camptocamp (community) no test, code review Approve
Leonardo Pistone Abstain
Stefan Rijnhart (Opener) Abstain
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+202831@code.staging.launchpad.net

Commit message

new module account_statement_cancel_line

Description of the change

New module account_statement_cancel_line. See __openep__.py for a description of what that does.

Thanks!

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

After an internal review, I added french translations, and a migration file to set the state correctly on existing statements, and I also merged upstream.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

I finished some fixes: an improved confirmation wizard, and a fix in the tests.

thanks!

Revision history for this message
Leonardo Pistone (lepistone) wrote :

I put this MP to 'work in progress' because I found a bug here. I'm doing a test and a fix.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

I fixed the bug i'd found: if the last line in draft was confirmed and the statement confirmed, we were skipping the balance check.

I added two tests that show that.

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM, Thank you Leonardo

review: Approve (code review, no tests)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for considering account_banking for your naming! Having this module will certainly help in merging the projects.

I tried to test the module, and was confronted by the dependency on account_default_draft_move. This dependency enforces alternative accounting practises which may be required in your region, but not in ours and should not be part of this change IMHO. Would you consider making this module agnostic towards the cancelling draft moves? With this, I mean that when cancelling a bank statement line, you can simply attempt to cancel and remove the associated move line and do the constraints in the various modules do their work.

review: Needs Information
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

s/cancelling draft moves/cancelling *posted* moves/

obviously

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks for your review Stefan.

The point you raise makes sense to me. Speaking as a developer and not an accountant, making this module agnostic on account_default_draft_move would be probably feasible, but the integration test would break. That makes sense to me, since the business logic changes a bit.

In fact I would not feel at ease adapting the test, because the two workflows (with or without default_draft) seem like two scenarios that I'd like to test separately to be somewhat confident.

To do that properly, probably I would need to remove the dependency here, write new tests for the non-default-draft case, and then write a new module that depends on account_statement_cancel_line and account_default_draft_move, with the tests I have now.

So your proposal makes sense to me, but I am not prepared to do that right now - it does not cover my use case anyway.

I would be happy to review and accept such a change if someone does it.

Leo

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

OK. Abstain for now then.

review: Abstain
Revision history for this message
Leonardo Pistone (lepistone) wrote :

oops, we found that that bug:

- create a statement with two lines
- confirm the first one
- confirm the whole statement

Then the first line gets two moves. At the moment, I pushed a yaml test to expose it.

review: Disapprove
132. By Leonardo Pistone

[fix] duplicate moves when confirming a statement with a confirmed line

Add a test to expose the bug.
To reproduce: create a statement with two lines, confirm one, and then confirm
the whole statement. The first line has two associated moves.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

The bug should now be fixed, and we are green again.

review: Abstain
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve (no test, code review)
Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

Ok is fine.

Thanks leo

everything seems to work smoothly now.

review: Approve (functional)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches