Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-932119-tde into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #932119 in OpenERP Addons: "Can not allow to create a period for fiscal 
year"
  https://bugs.launchpad.net/openobject-addons/+bug/932119

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-932119-tde/+merge/93162

Fixed date_start and date_stop in period creation. Using the 
fields.date.context_today in revno 6565 was performed using current dattimee 
instead of correct beginning and end of months timestamps (respectively ds and 
de).
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-932119-tde/+merge/93162
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-932119-tde.
=== modified file 'account/account.py'
--- account/account.py	2012-02-14 13:30:53 +0000
+++ account/account.py	2012-02-15 09:30:06 +0000
@@ -933,12 +933,11 @@
                 if de.strftime('%Y-%m-%d') > fy.date_stop:
                     de = datetime.strptime(fy.date_stop, '%Y-%m-%d')
 
-                context_today = fields.date.context_today(self,cr,uid,context=context)
                 period_obj.create(cr, uid, {
                     'name': ds.strftime('%m/%Y'),
                     'code': ds.strftime('%m/%Y'),
-                    'date_start': context_today,
-                    'date_stop': context_today,
+                    'date_start': fields.date.context_today(self, cr, uid, timestamp=ds, context=context),
+                    'date_stop': fields.date.context_today(self, cr, uid timestamp=de, context=context),
                     'fiscalyear_id': fy.id,
                 })
                 ds = ds + relativedelta(months=interval)

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to