← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 800767] Re: wrong dates in recurring entries

 

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

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/800767

Title:
  wrong dates in recurring entries

Status in OpenERP Modules (addons):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/800767/+subscriptions


References