summaryrefslogtreecommitdiff
path: root/addons/project/models/project.py
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/project/models/project.py
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/project/models/project.py')
-rw-r--r--addons/project/models/project.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index 2c5c6a5c8b2..565bd736b95 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import ast
from datetime import timedelta
from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import UserError, AccessError, ValidationError
-from odoo.tools.safe_eval import safe_eval
from odoo.tools.misc import format_date
@@ -406,7 +406,7 @@ class Project(models.Model):
}
action = self.env['ir.actions.act_window'].for_xml_id('project', 'rating_rating_action_view_project_rating')
action['name'] = _('Ratings of %s') % (self.name,)
- action_context = safe_eval(action['context']) if action['context'] else {}
+ action_context = ast.literal_eval(action['context']) if action['context'] else {}
action_context.update(self._context)
action_context['search_default_parent_res_name'] = self.name
action_context.pop('group_by', None)