[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:
parent
5b77f9d39f
commit
afae197073
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue