[IMP] website_event,sale_*,slides: use is_view_active
Use is_view_active instead of viewref which one is cached. closes odoo/odoo#55816 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -61,8 +61,6 @@ class WebsiteEventController(http.Controller):
|
||||
("date_begin", "<", sdn(today))],
|
||||
0],
|
||||
get_month_filter_domain('month', 0),
|
||||
get_month_filter_domain('nextmonth1', 1),
|
||||
get_month_filter_domain('nextmonth2', 2),
|
||||
['old', _('Past Events'), [
|
||||
("date_end", "<", sd(today))],
|
||||
0],
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap" class="o_wevent_index">
|
||||
<!-- Options -->
|
||||
<t t-set="opt_events_list_cards" t-value="request.website.viewref('website_event.opt_events_list_cards').active"/>
|
||||
<t t-set="opt_events_list_columns" t-value="request.website.viewref('website_event.opt_events_list_columns').active"/>
|
||||
<t t-set="opt_events_list_cards" t-value="is_view_active('website_event.opt_events_list_cards')"/>
|
||||
<t t-set="opt_events_list_columns" t-value="is_view_active('website_event.opt_events_list_columns')"/>
|
||||
<!-- Topbar -->
|
||||
<t t-call="website_event.index_topbar"/>
|
||||
<!-- Drag/Drop Area -->
|
||||
@@ -164,7 +164,7 @@
|
||||
<!-- Index - Events list -->
|
||||
<template id="events_list" name="Events list">
|
||||
<!-- Options -->
|
||||
<t t-set="opt_index_sidebar" t-value="request.website.viewref('website_event.opt_index_sidebar').active"/>
|
||||
<t t-set="opt_index_sidebar" t-value="is_view_active('website_event.opt_index_sidebar')"/>
|
||||
<t t-if="opt_events_list_columns" t-set="opt_event_size" t-value="opt_index_sidebar and 'col-md-6' or 'col-md-6 col-lg-4'"/>
|
||||
<t t-else="" t-set="opt_event_size" t-value="opt_index_sidebar and 'col-12' or 'col-xl-10 offset-xl-1'"/>
|
||||
<!-- No events -->
|
||||
|
||||
@@ -103,7 +103,7 @@ class WebsiteMembership(http.Controller):
|
||||
|
||||
# get google maps localization of partners
|
||||
google_map_partner_ids = []
|
||||
if request.website.viewref('website_membership.opt_index_google_map').active:
|
||||
if request.website.is_view_active('website_membership.opt_index_google_map'):
|
||||
google_map_partner_ids = MembershipLine.search(line_domain).get_published_companies(limit=2000)
|
||||
|
||||
search_domain = [('membership_state', '=', 'free'), ('website_published', '=', True)]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<template id="product_add_to_compare" name='Add to comparison in product page' inherit_id="website_sale.product" priority="8">
|
||||
<xpath expr="//div[@id='product_option_block']" position="inside">
|
||||
<t t-if="request.website.viewref('website_sale_comparison.add_to_compare').active">
|
||||
<t t-if="is_view_active('website_sale_comparison.add_to_compare')">
|
||||
<t t-set="product_variant" t-value="product_variant or product._create_first_product_variant()"/>
|
||||
<button t-if="product_variant" type="button" role="button" class="d-none d-md-inline-block btn btn-link mt16 o_add_compare_dyn" aria-label="Compare" t-att-data-product-product-id="product_variant.id" data-action="o_comparelist"><span class="fa fa-exchange"></span> Add to compare</button>
|
||||
</t>
|
||||
@@ -84,13 +84,12 @@
|
||||
-->
|
||||
<t t-set="product_variant" t-value="product_variant or product._create_first_product_variant()"/>
|
||||
<t t-set="id_list" t-value="[product_variant.id] if product_variant else []"/>
|
||||
<t t-set="compare_active" t-value="request.website.viewref('website_sale_comparison.add_to_compare').active"/>
|
||||
<t t-foreach="product.alternative_product_ids" t-as="alt_product">
|
||||
<t t-set="alt_product_variant_id" t-value="alt_product._create_first_product_variant().id"/>
|
||||
<t t-if="alt_product_variant_id" t-set="id_list" t-value="id_list + [alt_product_variant_id]"/>
|
||||
</t>
|
||||
<t t-set="ids" t-value="','.join([str(id) for id in id_list])"/>
|
||||
<div><span class='h3'>Suggested alternatives: </span><a t-if="len(id_list) > 1 and compare_active" role="button" class="btn btn-primary" t-attf-href="/shop/compare/?products=#{ids}"><i class="fa fa-exchange"></i> Compare</a></div>
|
||||
<div><span class='h3'>Suggested alternatives: </span><a t-if="len(id_list) > 1 and is_view_active('website_sale_comparison.add_to_compare')" role="button" class="btn btn-primary" t-attf-href="/shop/compare/?products=#{ids}"><i class="fa fa-exchange"></i> Compare</a></div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<template id="product_add_to_wishlist" name='Add to wishlist in product page' inherit_id="website_sale.product" priority="20">
|
||||
<xpath expr="//div[@id='product_option_block']" position="inside">
|
||||
<t t-if="request.website.viewref('website_sale_wishlist.add_to_wishlist').active">
|
||||
<t t-if="is_view_active('website_sale_wishlist.add_to_wishlist')">
|
||||
<t t-set="product_variant" t-value="product_variant or product._create_first_product_variant()"/>
|
||||
<t t-set="in_wish" t-value="product_variant and product_variant._is_in_wishlist()"/>
|
||||
<button t-if="product_variant" type="button" role="button" class="btn btn-link mt16 o_add_wishlist_dyn" t-att-disabled='in_wish or None' t-att-data-product-template-id="product.id" t-att-data-product-product-id="product_variant.id" data-action="o_wishlist"><span class="fa fa-heart" role="img" aria-label="Add to wishlist"></span> Add to wishlist</button>
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<template id="header" inherit_id="website.layout" name="Header Shop Wishlist Link">
|
||||
<xpath expr="//header//ul[@id='top_menu']/li[contains(@t-attf-class, 'o_wsale_my_cart')]" position="after">
|
||||
<t t-if="request.website.viewref('website_sale_wishlist.add_to_wishlist').active">
|
||||
<t t-if="is_view_active('website_sale_wishlist.add_to_wishlist')">
|
||||
<t t-set='wishcount' t-value="len(request.env['product.wishlist'].current())"/>
|
||||
<li class="nav-item o_wsale_my_wish" t-att-style="not wishcount and 'display:none;'">
|
||||
<a href="/shop/wishlist" class="nav-link">
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<div class="container o_wslides_home_main">
|
||||
<div class="row">
|
||||
<t t-set="has_side_column" t-value="request.website.viewref('website_slides.toggle_leaderboard').active"/>
|
||||
<t t-set="has_side_column" t-value="is_view_active('website_slides.toggle_leaderboard')"/>
|
||||
<t t-if="is_public_user">
|
||||
<div t-if="has_side_column" class="col-lg-3 order-3 order-lg-2">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user