Wrong effective date on journal entry when importing invoices in bank statement

Bug #789984 reported by Eetu Salpaharju
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

When you have account_payment (depends on account_voucher) installed you can select invoices into a bank statement. When you confirm the bank statement effective date of the journal entries generated are wrong. Now effective date is the date of an invoice but it obviously should be the date of the bank statement line.

<speculation>
The problem is originated in account_voucher module file account_voucher.py where account.bank.statement method create_move_from_st_line is overwritten. If a statement line have voucher_id the method does not create account_move_line with correct date but instead updates already existing account_move_line object. It only updates statement_id value but not date.
There is a obvious reason not to set new date in that module; account_move_line object does not let you change date in lines which are not in draft state.

With following patches journal entries works as expected. But overwriting write -method in account_move_line and let a date to be changed is not a good idea for sure.

account_voucher/account_voucher.py
951c951
< return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
---
> return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id, 'date': st_line.date}, context=context)

account/account_move_line.py
1139c1139
< if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals):
---
> if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals):

</speculation>

The OpenERP version I'm using is 6.0.2

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Edwin Dsouza(OpenERP) (eds-openerp) wrote :

Hello,

If the payment is done though voucher than the effective date is the current date, But if the payment is done through bank statement than the effective date is incorrect, which doesn't show current date.

Thank you.

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Eetu,

Its fixed in lp:~openerp-dev/openobject-addons/trunk-bug-789984-ara branch. it will be merged soon with trunk addons.
Revision ID: <email address hidden>
Revision No: 4753

Thanks for participation!

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Eetu Salpaharju (ex4) wrote :

Hi Ashvin,

Thank you for the fix.

Let's just hope that removing date check in account_move_line write method won't cause any problems in the future.

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

No need to remove date check in account_move_line write method. We can use update_check=False while write on move line from voucher.
i replied on the merge proposal too.

Thanks,
mra

Changed in openobject-addons:
milestone: none → 6.1
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Eetu,

Its fixed in lp:~openerp-dev/openobject-addons/trunk-bug-789984-ara branch as per comment #4. it will be merged soon with trunk addons.
Revision ID: <email address hidden>
Revision No: 4755

Thanks for participation!

Changed in openobject-addons:
status: Fix Committed → Fix Released
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.