wrong dates in recurring entries
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(
should be changed to:
date_maturity = context.
The move is created with date = context.
2) In the line 2086:
entry['name'] = model.name%
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.
Related branches
- Mustufa Rangwala (Open ERP) (community): Approve
- Bharat Devnani (Open ERP) (community): Needs Resubmitting
- qdp (OpenERP): Pending requested
-
Diff: 42 lines (+6/-4)1 file modifiedaccount/account.py (+6/-4)
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 |
Changed in openobject-addons: | |
milestone: | none → 6.1 |
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