[FIX] stock: mute orm logger before checking access rules

bzr revid: chs@openerp.com-20131108230224-tqj0tg5xgz8ramwd
This commit is contained in:
Christophe Simonis 2013-11-09 00:02:24 +01:00
parent 4166baa1ba
commit 9a1c54d242
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@
from openerp.osv import fields, osv, orm
from openerp.tools.translate import _
from openerp.tools import mute_logger
class stock_fill_inventory(osv.osv_memory):
_name = "stock.fill.inventory"
@ -29,7 +30,8 @@ class stock_fill_inventory(osv.osv_memory):
def _default_location(self, cr, uid, ids, context=None):
try:
location = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
location.check_access_rule('read', context=context)
with mute_logger('openerp.osv.orm'):
location.check_access_rule('read', context=context)
location_id = location.id
except (ValueError, orm.except_orm), e:
return False