Replace eval by safe_eval
This commit is contained in:
parent
565135f77f
commit
665198b8d7
@ -21,6 +21,7 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields, api, exceptions, _
|
||||
from openerp.tools.safe_eval import safe_eval as eval
|
||||
from functools import partial
|
||||
import re
|
||||
|
||||
@ -66,7 +67,8 @@ class AccountDocumentTemplate(models.Model):
|
||||
try:
|
||||
recurse_lines = partial(self.lines, computed_lines=computed_lines)
|
||||
computed_lines[line_number] = eval(
|
||||
line.python_code.replace('L', 'recurse_lines')
|
||||
line.python_code.replace('L', 'recurse_lines'),
|
||||
locals_dict={'recurse_lines': recurse_lines}
|
||||
)
|
||||
except KeyError:
|
||||
raise exceptions.Warning(
|
||||
|
Loading…
Reference in New Issue
Block a user