use safe_eval
This commit is contained in:
parent
b95fab9b4c
commit
37fbf936bb
@ -21,7 +21,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp import models, fields, api, exceptions, _
|
from openerp import models, fields, api, exceptions, _
|
||||||
from openerp.tools.safe_eval import safe_eval as eval
|
from openerp.tools.safe_eval import safe_eval
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class AccountDocumentTemplate(models.Model):
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
recurse_lines = partial(self.lines, computed_lines=computed_lines)
|
recurse_lines = partial(self.lines, computed_lines=computed_lines)
|
||||||
computed_lines[line_number] = eval(
|
computed_lines[line_number] = safe_eval(
|
||||||
line.python_code.replace('L', 'recurse_lines'),
|
line.python_code.replace('L', 'recurse_lines'),
|
||||||
locals_dict={'recurse_lines': recurse_lines}
|
locals_dict={'recurse_lines': recurse_lines}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user