Merge lp:~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile into lp:~banking-addons-team/banking-addons/6.1-dev

Proposed by Stefan Rijnhart (Opener)
Status: Superseded
Proposed branch: lp:~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile
Merge into: lp:~banking-addons-team/banking-addons/6.1-dev
Diff against target: 53 lines (+25/-5)
1 file modified
account_banking/banking_import_transaction.py (+25/-5)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile
Reviewer Review Type Date Requested Status
James Jesudason Pending
Review via email: mp+93981@code.launchpad.net

Description of the change

This branch fixes an attempt to copy() a list. In addition, a logical error was fixed in the related code path of partial unreconciliation.

To post a comment you must log in.
Revision history for this message
James Jesudason (jamesj) wrote :

I've not merged this as yet as I think that these methods are no longer called. Since the account.voucher is handling partial and full reconciliation, I'm not sure that we'll need these methods. Once you get to testing the 6.1dev branch in more detail, perhaps you could check to see if this is still necessary.

Unmerged revisions

113. By Stefan Rijnhart (Opener)

[FIX] Partial unreconcile exception and logical error

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/banking_import_transaction.py'
2--- account_banking/banking_import_transaction.py 2012-02-20 19:41:49 +0000
3+++ account_banking/banking_import_transaction.py 2012-02-21 12:38:44 +0000
4@@ -518,12 +518,12 @@
5 if full:
6 line_partial_ids = []
7 else:
8- line_partial_ids = line_ids.copy()
9+ line_partial_ids = list(line_ids)
10 line_ids = []
11 reconcile_obj.write(
12 cr, uid, reconcile.id,
13- { 'line_partial_ids': [(6, 0, line_ids)],
14- 'line_id': [(6, 0, line_partial_ids)],
15+ { 'line_partial_ids': [(6, 0, line_partial_ids)],
16+ 'line_id': [(6, 0, line_ids)],
17 }, context=context)
18 else:
19 reconcile_obj.unlink(cr, uid, reconcile.id, context=context)
20@@ -655,11 +655,31 @@
21
22 def _cancel_move(
23 self, cr, uid, transaction_id, context=None):
24+ """
25+ Undo the reconciliation of a transaction with a move line
26+ in the system: Retrieve the move line from the bank statement line's
27+ move that is reconciled with the matching move line recorded
28+ on the transaction. Do not actually remove the latter from the
29+ reconciliation, as it may be further reconciled.
30+ Unreconcile the bank statement move line and the optional
31+ write-off move line
32+ """
33 statement_line_obj = self.pool.get('account.bank.statement.line')
34 transaction = self.browse(cr, uid, transaction_id, context=context)
35- move_line_id = transaction.move_line_id.id
36 currency = transaction.statement_line_id.statement_id.currency
37- line_ids = [transaction.move_line_id.id]
38+ reconcile_id = (
39+ transaction.move_line_id.reconcile_id and
40+ transaction.move_line_id.reconcile_id.id or
41+ transaction.move_line_id.reconcile_partial_id and
42+ transaction.move_line_id.reconcile_partial_id.id
43+ )
44+ for line in transaction.statement_line_id.move_id.line_id:
45+ line_reconcile = line.reconcile_id or line.reconcile_partial_id
46+ if line_reconcile and line_reconcile.id == reconcile_id:
47+ st_line_line = line
48+ break
49+ line_ids = [st_line_line.id]
50+ # Add the write off line
51 if transaction.writeoff_move_line_id:
52 line_ids.append(transaction.writeoff_move_line_id.id)
53 self._do_move_unreconcile(

Subscribers

People subscribed via source and target branches