Skip to content

Commit

Permalink
[FIX] disable_invalid_filters: datetime / context_today / relativedelta
Browse files Browse the repository at this point in the history
  • Loading branch information
royle-vietnam committed Jul 14, 2022
1 parent 0e45373 commit 1c991df
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,18 @@ def format_message(f):
globaldict = {'uid': env.uid}
if version_info[0] < 14:
globaldict.update({'time': time})
if version_info[0] >= 13:
try:
from odoo.tools.safe_eval import datetime as safe_eval_datetime
from odoo.tools.safe_eval import dateutil
except ImportError:
import datetime as safe_eval_datetime
import dateutil
globaldict.update({
'datetime': safe_eval_datetime,
'context_today': safe_eval_datetime.datetime.now,
'relativedelta': dateutil.relativedelta.relativedelta,
})
# DOMAIN
try:
with savepoint(env.cr):
Expand Down

0 comments on commit 1c991df

Please sign in to comment.