[FIX] Removed the store=True (too much access to DB), as this is not necessary. Fixed dict of dict: inner dict instantiation is done for each iteration, because argument management in python made all dicts pointers to the same dict

bzr revid: tde@openerp.com-20120330100337-miqra4q5sjokt7en
This commit is contained in:
Thibault Delavallée
2012-03-30 12:03:37 +02:00
parent 03cd5c47b2
commit 2f97bcdf7d
+4 -3
View File
@@ -258,8 +258,9 @@ class ir_ui_menu(osv.osv):
def _get_needaction(self, cr, uid, ids, field_names, args, context=None):
if context is None:
context = {}
res = dict.fromkeys(ids, {})
res = dict.fromkeys(ids)
for menu in self.browse(cr, uid, ids, context=context):
res[menu.id] = {}
if menu.action and menu.action.type == 'ir.actions.act_window' and menu.action.res_model:
menu_needaction_res = osv.osv.get_needaction_info(cr, uid, menu.action.res_model, uid, domain=menu.action.domain, context=context)
else:
@@ -284,8 +285,8 @@ class ir_ui_menu(osv.osv):
'web_icon_hover':fields.char('Web Icon File (hover)', size=128),
'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', readonly=True, store=True, multi='icon'),
'web_icon_hover_data':fields.function(_get_image_icon, string='Web Icon Image (hover)', type='binary', readonly=True, store=True, multi='icon'),
'has_needaction': fields.function(_get_needaction,store=True,string='User has actions to perform', type='boolean', help='', multi='has_action'),
'needaction_ctr': fields.function(_get_needaction,store=True, string='Action counter', type='integer', help='', multi='has_action'),
'has_needaction': fields.function(_get_needaction, string='User has actions to perform', type='boolean', help='', multi='has_action'),
'needaction_ctr': fields.function(_get_needaction, string='Action counter', type='integer', help='', multi='has_action'),
'action': fields.function(_action, fnct_inv=_action_inv,
type='reference', string='Action',
selection=[