[IMP] speed improvement + small bug

bzr revid: fp@tinyerp.com-20131203171033-oe6pkzb9jal3ril8
This commit is contained in:
Fabien Pinckaers 2013-12-03 18:10:33 +01:00
parent ee2d4327a8
commit 642fce4a5b
2 changed files with 7 additions and 5 deletions

View File

@ -181,10 +181,12 @@ class website(osv.osv):
return self.pool['website'].browse(cr, uid, 1, context=context)
def preprocess_request(self, cr, uid, ids, request, context=None):
# TODO FP: is_website_publisher and editable in context should be removed
# for performance reasons (1 query per image to load) but also to be cleaner
# I propose to replace this by a group 'base.group_website_publisher' on the
# view that requires it.
Access = request.registry['ir.model.access']
is_website_publisher = (
Access.check_groups(cr, uid, 'base.group_website_publisher')
and Access.check(cr, uid, 'ir.ui.view', 'write', False, context))
is_website_publisher = Access.check(cr, uid, 'ir.ui.view', 'write', False, context)
lang = request.context['lang']
is_master_lang = lang == request.website.default_lang_code

View File

@ -42,8 +42,8 @@
</template>
<template id="products_cart" name="Shopping cart">
<div class="ribbon-wrapper" contentEditable="false">
<div class="ribbon"><span contentEditable="true">Promo</span></div>
<div class="ribbon-wrapper">
<div class="ribbon">Promo</div>
</div>
<div class="oe_product_description">
<a t-href="/shop/product/#{ slug(product) }/" t-keep-query="category,search,filter_domain">