From d634220a9f415d2d25aaeced1c39905bea8e0c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 27 Jul 2017 09:40:14 +0200 Subject: [PATCH] Allow to specify datetime related values in XML files issue6660 review35181002 --- CHANGELOG | 1 + trytond/convert.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a3b48802c4..21d5be1b15 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Allow to specify datetime related values in XML files * Add environment variables to wsgi script * Add unique ids check on RPC * Assert unique records on ModelView.button and Workflow.transition diff --git a/trytond/convert.py b/trytond/convert.py index 9d50bb879c..315e18acea 100644 --- a/trytond/convert.py +++ b/trytond/convert.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import time +import datetime from xml import sax import logging import re @@ -230,6 +231,7 @@ class RecordTagHandler: context['version'] = __version__.rsplit('.', 1)[0] context['ref'] = self.mh.get_id context['Decimal'] = Decimal + context['datetime'] = datetime if pyson_attr: context.update(CONTEXT) value = eval(eval_attr, context)