[IMP] base: timezone handling in server actions.

Give access to `pytz.timezone` (as `timezone`) in `ir.actions.server`
records. Usefull when dealing with date(time)s.
This commit is contained in:
Christophe Simonis 2015-11-12 12:23:27 +01:00
parent 5b77f9d39f
commit afae197073
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import os
import time
import datetime
import dateutil
import pytz
import openerp
from openerp import SUPERUSER_ID
@ -944,6 +945,9 @@ class ir_actions_server(osv.osv):
'time': time,
'datetime': datetime,
'dateutil': dateutil,
# NOTE: only `timezone` function. Do not provide the whole `pytz` module as users
# will have access to `pytz.os` and `pytz.sys` to do nasty things...
'timezone': pytz.timezone,
# orm
'env': env,
'model': model,