credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #04710
lp:~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile into lp:~banking-addons-team/banking-addons/6.1-dev
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile into lp:~banking-addons-team/banking-addons/6.1-dev.
Requested reviews:
James Jesudason (jamesj)
For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile/+merge/93981
This branch fixes an attempt to copy() a list. In addition, a logical error was fixed in the related code path of partial unreconciliation.
--
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-interactive-fix-partial-unreconcile/+merge/93981
Your team Banking Addons Team is subscribed to branch lp:~banking-addons-team/banking-addons/6.1-dev.
=== modified file 'account_banking/banking_import_transaction.py'
--- account_banking/banking_import_transaction.py 2012-02-20 19:41:49 +0000
+++ account_banking/banking_import_transaction.py 2012-02-21 12:38:44 +0000
@@ -518,12 +518,12 @@
if full:
line_partial_ids = []
else:
- line_partial_ids = line_ids.copy()
+ line_partial_ids = list(line_ids)
line_ids = []
reconcile_obj.write(
cr, uid, reconcile.id,
- { 'line_partial_ids': [(6, 0, line_ids)],
- 'line_id': [(6, 0, line_partial_ids)],
+ { 'line_partial_ids': [(6, 0, line_partial_ids)],
+ 'line_id': [(6, 0, line_ids)],
}, context=context)
else:
reconcile_obj.unlink(cr, uid, reconcile.id, context=context)
@@ -655,11 +655,31 @@
def _cancel_move(
self, cr, uid, transaction_id, context=None):
+ """
+ Undo the reconciliation of a transaction with a move line
+ in the system: Retrieve the move line from the bank statement line's
+ move that is reconciled with the matching move line recorded
+ on the transaction. Do not actually remove the latter from the
+ reconciliation, as it may be further reconciled.
+ Unreconcile the bank statement move line and the optional
+ write-off move line
+ """
statement_line_obj = self.pool.get('account.bank.statement.line')
transaction = self.browse(cr, uid, transaction_id, context=context)
- move_line_id = transaction.move_line_id.id
currency = transaction.statement_line_id.statement_id.currency
- line_ids = [transaction.move_line_id.id]
+ reconcile_id = (
+ transaction.move_line_id.reconcile_id and
+ transaction.move_line_id.reconcile_id.id or
+ transaction.move_line_id.reconcile_partial_id and
+ transaction.move_line_id.reconcile_partial_id.id
+ )
+ for line in transaction.statement_line_id.move_id.line_id:
+ line_reconcile = line.reconcile_id or line.reconcile_partial_id
+ if line_reconcile and line_reconcile.id == reconcile_id:
+ st_line_line = line
+ break
+ line_ids = [st_line_line.id]
+ # Add the write off line
if transaction.writeoff_move_line_id:
line_ids.append(transaction.writeoff_move_line_id.id)
self._do_move_unreconcile(