diff --git a/date_range/__manifest__.py b/date_range/__manifest__.py index 6b048952e..df33594f2 100644 --- a/date_range/__manifest__.py +++ b/date_range/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Date Range", "summary": "Manage all kind of date range", - "version": "10.0.1.0.0", + "version": "10.0.1.0.1", "category": "Uncategorized", "website": "https://odoo-community.org/", "author": "ACSONE SA/NV, Odoo Community Association (OCA)", diff --git a/date_range/security/date_range_security.xml b/date_range/security/date_range_security.xml index 20bea9bfe..87862f84b 100644 --- a/date_range/security/date_range_security.xml +++ b/date_range/security/date_range_security.xml @@ -1,19 +1,13 @@ - - - - Date Range Type multi-company - - - ['|',('company_id','=',user.company_id.id),('company_id','=',False)] - - - - Date Range multi-company - - - ['|',('company_id','=',user.company_id.id),('company_id','=',False)] - - - + + + Date Range Type multi-company + + ['|',('company_id','=',user.company_id.id),('company_id','=',False)] + + + Date Range multi-company + + ['|',('company_id','=',user.company_id.id),('company_id','=',False)] + diff --git a/date_range/wizard/date_range_generator.py b/date_range/wizard/date_range_generator.py index 7abfba99d..c4c37415d 100644 --- a/date_range/wizard/date_range_generator.py +++ b/date_range/wizard/date_range_generator.py @@ -43,6 +43,7 @@ class DateRangeGenerator(models.TransientModel): count=self.count+1) vals = list(vals) date_ranges = [] + month_digits = len(unicode(self.count)) for idx, dt_start in enumerate(vals[:-1]): date_start = fields.Date.to_string(dt_start.date()) # always remove 1 day for the date_end since range limits are @@ -50,7 +51,9 @@ class DateRangeGenerator(models.TransientModel): dt_end = vals[idx+1].date() - relativedelta(days=1) date_end = fields.Date.to_string(dt_end) date_ranges.append({ - 'name': '%s-%d' % (self.name_prefix, idx + 1), + 'name': '%s-%s' % ( + self.name_prefix, + unicode(idx + 1).zfill(month_digits)), 'date_start': date_start, 'date_end': date_end, 'type_id': self.type_id.id,