6.0 reconciliation doesn't work

Bug #942876 reported by Grzegorz Grzelak (OpenGLOBE.pl)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Banking Addons
Fix Released
Critical
Stefan Rijnhart (Opener)

Bug Description

I am not sure if you are interested to fix version 6.0. (In 6.1 I see it is different concept)

I get with my own developed parser that import bank statement wizard recognises remote_account and partner and even says that matched statement line. I see that invoice account move is marked with created reconciliation ID. But this reconciliation ID doesn't appear on bank statement line and doesn't create full reconciliation after confirming the bank statement.

I have changed some lines in bank_import.py wizard and it started to work.
Generally I added reconciliation ID directly from create method because it cannot be taken later until whole wizard finishes.

Exact line numbers can differ as I added some log entries to analyse the code. I have changed lines with comment # GG. Another change is at the end.

around line 79:

        if partial:
            retval.reconcile_id = reconcile_obj.create( # GG
                cursor, uid, {
                    'type': 'auto',
                    'line_partial_ids': [(6, 0, [move_line.id])]
                    }
            )
        else:
            if move_line.reconcile_partial_id:
                partial_ids = [x.id for x in
                               move_line.reconcile_partial_id.line_partial_ids
                               ]
                reconcile_obj.write(
                    cursor, uid, move_line.reconcile_partial_id.id, {
                        'type': 'auto',
                        'line_id': [(6, 0, [move_line.id] + partial_ids)],
                        'line_partial_ids': [(6, 0, [])],
                        }
                    )
            else:
                retval.reconcile_id = reconcile_obj.create( # GG
                    cursor, uid, {
                        'type': 'auto',
                        'line_id': [(6, 0, [move_line.id])],
                }
            )
        return retval

Another change around line 834 (again one change marked with # GG)
                if move_info:
                    values.type = move_info.type
                    values.reconcile_id = (
                        move_info.reconcile_id or # GG
                        move_info.move_line.reconcile_id and
                        move_info.move_line.reconcile_id.id or
                        move_info.move_line.reconcile_partial_id and
                        move_info.move_line.reconcile_partial_id.id
                        )
                    values.partner_id = move_info.partner_id
                    values.partner_bank_id = move_info.partner_bank_id

Related branches

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

Hi Gregorz,

thank you for reporting this problem and suggesting a fix! Does this problem occur with every matched transaction? In general, reconciliation of matched transaction is known to work well, except that your modification is in a recently modified part of the code. It may be this recent modification that is at fault (http://bazaar.launchpad.net/~banking-addons-team/banking-addons/6.0/revision/71).

Looking at your code, it registers the id of the generated reconciliation on the move_info struct, separately from the move line. The OpenERP reconciliation logic dictates that the id of the reconciliation should also be available from the move_line itself, like the original code retrieves it. However, we are aware of caching issues with browse objects such as the move_line in this piece of the code. We will need to refresh the browse record after having effectively written its reconcile_id by creating the reconciliation object.

Thanks again,
Stefan.

Changed in banking-addons:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Stefan Rijnhart (Therp) (stefan-therp)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Gregorz,

our solution is commited to https://code.launchpad.net/~banking-addons-team/banking-addons/6.0-lp942876-clear_browse_record_cache. It would be great if you could verify that it solves the problems with the reconciliation on your setup.

Regards,
Stefan.

Changed in banking-addons:
status: Confirmed → Fix Committed
Changed in banking-addons:
status: Fix Committed → Fix Released
Revision history for this message
Grzegorz Grzelak (OpenGLOBE.pl) (grzegorz-og.pl) wrote :

Yes, it works after this fix.

Thank you. I am impressed of the framework.

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

Grzegorz,

Thanks for confirming!

Credits of the excellent design go to Pieter Kersten of the original project https://launchpad.net/account-banking.

Cheers,
Stefan.

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.