Use safe_eval instead of eval for issue1640
This commit is contained in:
+2
-1
@@ -6,6 +6,7 @@ from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.wizard import Wizard
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.tools import safe_eval
|
||||
|
||||
|
||||
class Template(ModelSQL, ModelView):
|
||||
@@ -103,7 +104,7 @@ class Product(ModelSQL, ModelView):
|
||||
return False
|
||||
if operator == "=":
|
||||
operator= "=="
|
||||
return (eval(str(value) + operator + str(operand)))
|
||||
return (safe_eval(str(value) + operator + str(operand)))
|
||||
|
||||
def search_quantity(self, name, domain=None):
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
Reference in New Issue
Block a user