From a0276f1ef24e68c986b2f6c73d4b32792276bb70 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 15 Feb 2016 09:20:59 +0100 Subject: [PATCH] [SEC] fix unsafe eval in unported addon --- stock_move_location/stock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stock_move_location/stock.py b/stock_move_location/stock.py index be0a5ae2e..396f08ea7 100644 --- a/stock_move_location/stock.py +++ b/stock_move_location/stock.py @@ -19,8 +19,9 @@ # ################################################################################# -from osv import fields, osv -from tools.translate import _ +from openerp.osv import fields, osv +from openerop.tools.translate import _ +from openerp.tools.safe_eval import safe_eval #class stock_fill_inventory(osv.osv_memory): # _inherit = "stock.fill.inventory" @@ -116,7 +117,7 @@ class stock_inventory(osv.osv): model_id = mod_obj.search(cr, uid, [('name', '=', 'inventory_acquisition_link_1')])[0] act_id = mod_obj.read(cr, uid, model_id, ['res_id'])['res_id'] act = act_obj.read(cr, uid, act_id) - context = eval(act['context']) + context = safe_eval(act['context']) context['default_inventory_id'] = inventory_data.id context['default_name'] = inventory_data.name act['context'] = context