diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-01-22 15:16:22 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-01-28 13:58:05 +0000 |
| commit | a74a6480302620be364d2d15717fce59db3ddf4e (patch) | |
| tree | ea350f32d91ceb078c4de5efd754bc15c08b450b /addons/mail/wizard | |
| parent | 41a465bc869a96b7a4e2b49a691360827019b0ea (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/mail/wizard')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index fe4660e451b..520b8f94339 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +import ast import base64 import re from odoo import _, api, fields, models, tools -from odoo.tools.safe_eval import safe_eval from odoo.exceptions import UserError @@ -215,7 +215,7 @@ class MailComposer(models.TransientModel): ActiveModel = ActiveModel.with_context(mail_notify_force_send=False, mail_create_nosubscribe=True) # wizard works in batch mode: [res_id] or active_ids or active_domain if mass_mode and wizard.use_active_domain and wizard.model: - res_ids = self.env[wizard.model].search(safe_eval(wizard.active_domain)).ids + res_ids = self.env[wizard.model].search(ast.literal_eval(wizard.active_domain)).ids elif mass_mode and wizard.model and self._context.get('active_ids'): res_ids = self._context['active_ids'] else: |
