summaryrefslogtreecommitdiff
path: root/addons/google_drive/models
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-01-22 15:16:22 +0000
committerMartin Trigaux <mat@odoo.com>2020-01-28 13:58:05 +0000
commita74a6480302620be364d2d15717fce59db3ddf4e (patch)
treeea350f32d91ceb078c4de5efd754bc15c08b450b /addons/google_drive/models
parent41a465bc869a96b7a4e2b49a691360827019b0ea (diff)
[IMP] *: use ast.literal_eval
When simply need to parse a domain, it is easier Add .strip() on ir.ui.view as ast.literal_eval produces an syntax error if the node starts with spaces (as done in the xpath of hr_attendance.view_employee_form_inherit_hr_attendance) closes odoo/odoo#43831 Related: odoo/enterprise#7894 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/google_drive/models')
-rw-r--r--addons/google_drive/models/google_drive.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py
index 14573d42a82..212062bbc70 100644
--- a/addons/google_drive/models/google_drive.py
+++ b/addons/google_drive/models/google_drive.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import ast
import logging
import json
import re
@@ -9,7 +10,6 @@ import werkzeug.urls
from odoo import api, fields, models
from odoo.exceptions import RedirectWarning, UserError
-from odoo.tools.safe_eval import safe_eval
from odoo.tools.translate import _
from odoo.addons.google_account.models.google_service import GOOGLE_TOKEN_ENDPOINT, TIMEOUT
@@ -165,8 +165,8 @@ class GoogleDrive(models.Model):
if config.filter_id.user_id and config.filter_id.user_id.id != self.env.user.id:
#Private
continue
- domain = [('id', 'in', [res_id])] + safe_eval(config.filter_id.domain)
- additionnal_context = safe_eval(config.filter_id.context)
+ domain = [('id', 'in', [res_id])] + ast.literal_eval(config.filter_id.domain)
+ additionnal_context = ast.literal_eval(config.filter_id.context)
google_doc_configs = self.env[config.filter_id.model_id].with_context(**additionnal_context).search(domain)
if google_doc_configs:
config_values.append({'id': config.id, 'name': config.name})