diff options
| author | Vincent Renaville@camptocamp <> | 2010-06-28 11:40:26 +0530 |
|---|---|---|
| committer | vra <vra@tinyerp.com> | 2010-06-28 11:40:26 +0530 |
| commit | d3f70e05fe7a19eaad75ecc398febd6d4527aa2a (patch) | |
| tree | 7c018a2613a4502a78ce65efab5ae436151e6fd1 | |
| parent | b5c6dda6ac4f111ab527e236ddcafd0f597f79d1 (diff) | |
[FIX] Account : Bank statement problem corrected for partial payments
bzr revid: vra@tinyerp.com-20100628061026-5g6nzppg5esm4jgi
| -rw-r--r-- | addons/account/account_bank_statement.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 0e46944a436..572cb9d04fd 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -303,6 +303,13 @@ class account_bank_statement(osv.osv): _('Ledger Posting line "%s" is not valid') % line.name) if move.reconcile_id and move.reconcile_id.line_ids: + ## Search if move has already a partial reconciliation + previous_partial = False + for line_reconcile_move in move.reconcile_id.line_ids: + if line_reconcile_move.reconcile_partial_id: + previous_partial = True + break + ## torec += map(lambda x: x.id, move.reconcile_id.line_ids) #try: if abs(move.reconcile_amount-move.amount)<0.0001: @@ -312,8 +319,14 @@ class account_bank_statement(osv.osv): for entry in move.reconcile_id.line_new_ids: writeoff_acc_id = entry.account_id.id break - - account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) + ## If we have already a partial reconciliation + ## We need to make a partial reconciliation + ## To add this amount to previous paid amount + if previous_partial: + account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) + ## If it's the first reconciliation, we do a full reconciliation as regular + else: + account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) else: account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) #except: |
