[FIX] account : Create Monthly Periods : unique key violation on Opening Periods
authorGuewen Baconnier <>
Mon, 28 Nov 2011 05:09:38 +0000 (10:39 +0530)
committerDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Mon, 28 Nov 2011 05:09:38 +0000 (10:39 +0530)
lp bug: https://launchpad.net/bugs/894707 fixed

bzr revid: mdi@tinyerp.com-20111128050938-5e2vizusnvq8zbth

addons/account/account.py

index 8aa1569..f766b58 100644 (file)
@@ -880,7 +880,7 @@ class account_fiscalyear(osv.osv):
         for fy in self.browse(cr, uid, ids, context=context):
             ds = datetime.strptime(fy.date_start, '%Y-%m-%d')
             period_obj.create(cr, uid, {
-                    'name': _('Opening Period'),
+                    'name':  "%s %s" % (_('Opening Period'), ds.strftime('%Y')),
                     'code': ds.strftime('00/%Y'),
                     'date_start': ds,
                     'date_stop': ds,