diff --git a/CHANGELOG b/CHANGELOG index 1066ae91c4..f2908a4b36 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Remove egenix-mx-base and replace it by python-dateutil + Version 1.4.0 - 2009-10-19 * Bug fixes (see mercurial logs for details) diff --git a/INSTALL b/INSTALL index abd192dbeb..5b2915b175 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,7 @@ Prerequisites ------------- * Python 2.4 or later (http://www.python.org/) - * egenix-mx-base (http://www.egenix.com/products/python/) + * python-dateutil (http://labix.org/python-dateutil) * trytond (http://www.tryton.org/) * trytond_product (http://www.tryton.org/) * trytond_stock (http://www.tryton.org/) diff --git a/forecast.py b/forecast.py index a0ef07d2e2..76cdc94cdb 100644 --- a/forecast.py +++ b/forecast.py @@ -3,7 +3,8 @@ from trytond.model import ModelView, ModelWorkflow, ModelSQL, fields from trytond.wizard import Wizard import datetime -import mx.DateTime +import time +from dateutil.relativedelta import relativedelta STATES = { 'readonly': "state != 'draft'", @@ -380,10 +381,7 @@ class ForecastComplete(Wizard): res = {} for field in ("to_date", "from_date"): - date = mx.DateTime.strptime(str(forecast[field]), '%Y-%m-%d') - new_date = date - mx.DateTime.RelativeDateTime(years=1) - res[field] = datetime.date(new_date.year, new_date.month, - new_date.day) + res[field] = forecast[field] - relativedelta(years=1) return res def _get_product_quantity(self, cursor, user, data, context=None): diff --git a/setup.py b/setup.py index 88a74c83be..4f93ff3049 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import re info = eval(file('__tryton__.py').read()) -requires = ['egenix-mx-base'] +requires = ['python-dateutil'] for dep in info.get('depends', []): if not re.match(r'(ir|res|workflow|webdav)(\W|$)', dep): requires.append('trytond_' + dep)