Skip to Content
मेन्यू
This question has been flagged
2 Replies
2696 Views

Hey

I am trying to implement safe_eval to calculate some formulas but when I try to "import math" it gives me an error  


safe_eval('aoc = math.pi * (radius**2)',{'radius': 3},mode='exec',nocopy= True)
Any suggestions would be greatly appreciated

Thanks


Avatar
Discard
Author Best Answer

I  blacklisted the import function somewhere in tools.py and now I can import math function

Avatar
Discard
Best Answer

Hi,
Can you try importing the library “from odoo.tools.safe_eval import safe_eval” instead of using math library and then use the function safe_eval

Avatar
Discard
Related Posts Replies Views Activity
0
मई 23
1504
1
सित॰ 22
3077
3
मई 23
6905
0
नव॰ 22
2111
0
अक्तू॰ 22
2679