wrong dates in recurring entries

Bug #800767 reported by Manu
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

I'm using 6.0.2 updated to rev 4670.

Imagine that you have a subscription that starts on 2011/01/01 and that should generate a move each month. The lines have date maturity set to today.The move that should be generated will have a ref like 'PAYMENTS %(month)s.

Now imagine that the current date is 2011/03/02 (second of march) and I haven't executed the generate entries wizard because the accountant was ill. When he generates the entries, 3 entries will be created:

Payments 03 with date 2011/01/01. The lines will have due date 2011/03/02
Payments 03 with date 2011/02/01. The lines will have due date 2011/03/02
Payments 03 with date 2011/03/01. The lines will have due date 2011/03/02

As you can see, the entries are wrong. There are two bugs in the account.model generate method:

1) In the line 2107:

date_maturity = time.strftime('%Y-%m-%d')

should be changed to:

date_maturity = context.get('date',time.strftime('%Y-%m-%d'))

The move is created with date = context.get('date',time.strftime('%Y-%m-%d')) and the line should be created with the same date_maturity (if line.date_maturity == 'partner' it will be changed, but using the proper base date).

2) In the line 2086:

entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}

the substitution of known patterns is done but the current time is used. However, the substitution should be done using the context['date'] instead of the current time if available.

Please fix it.

Also, while you are touching the code, why don't you apply the pattern substitution also in the line.names? It is really useful for the accountants when viewing a report of account.move.lines becaues if not the recurring entries can't be distinguished easily.

And finally, I think that another substitution pattern would be useful: 'day'.

Thank you.

Tags: 6.0.2

Related branches

Revision history for this message
Manu (manu-tiedra) wrote :

I forgot to say that the expected results are:

Payments 01 with date 2011/01/01. The lines will have due date 2011/01/01
Payments 02 with date 2011/02/01. The lines will have due date 2011/02/01
Payments 03 with date 2011/03/01. The lines will have due date 2011/03/01

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Manu,

Thanks for reporting the issue. Following are the Revision ID and Number of the bug:

Revision ID : <email address hidden>
Revision Number : 4889

We have solved the issues which you mentioned on the line number 2107 and 2086, and for the pattern matching in line.names we should consider this as a wishlist for that you have to post a new bug on launchpad.

The solution of this bug will be merged in addons soon.

Thanks & Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
milestone: none → 6.1
Revision history for this message
qdp (OpenERP) (qdp) wrote :

Hi Manu,

the 2 fixes landed on trunk in revision 5389. About your 2 suggestions, i'm not sure it could be really usefull. Feel free to create a poll for that in feedback.openerp.com.

Anyway, thanks for your contribution,
Quentin

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.