[IMP] website_sale: multi image by default
Remove the option to switch from simple image to multi mode. If only 1 image, multi image show it without carousel
This commit is contained in:
@@ -30,7 +30,6 @@ class ResConfigSettings(models.TransientModel):
|
||||
('website', "Delivery methods are selectable on the website: the customer pays for shipping costs"),
|
||||
], string="Shipping Management")
|
||||
|
||||
group_website_multiimage = fields.Boolean(string='Multi-Images', implied_group='website_sale.group_website_multi_image', group='base.group_portal,base.group_user,base.group_public')
|
||||
group_delivery_invoice_address = fields.Boolean(string="Shipping Address", implied_group='sale.group_delivery_invoice_address')
|
||||
|
||||
module_website_sale_options = fields.Boolean("Optional Products")
|
||||
|
||||
@@ -36,11 +36,6 @@
|
||||
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="website_sale.group_website_multi_image" model="res.groups">
|
||||
<field name="name">Show multi image on eCommerce</field>
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
<record id="sales_team.group_sale_manager" model="res.groups">
|
||||
<field name="implied_ids" eval="[(4, ref('website.group_website_publisher'))]"/>
|
||||
</record>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</button>
|
||||
</button>
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Images" groups="website_sale.group_website_multi_image">
|
||||
<page string="Images" groups="base.group_no_one">
|
||||
<field name="product_image_ids" mode="kanban" context="{'default_name': name, 'default_product_tmpl_id': active_id}">
|
||||
<kanban string="Product Images">
|
||||
<field name="name"/>
|
||||
|
||||
@@ -25,17 +25,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="product_image_setting">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_website_multiimage"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_website_multiimage"/>
|
||||
<div class="text-muted">
|
||||
Display an images carousel on product pages
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="digital_content_setting" title="Provide customers with product-specific links or downloadable content in the confirmation page of the checkout process if the payment gets through. To do so, attach some files to a product using the new Files button and publish them.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_website_sale_digital"/>
|
||||
|
||||
@@ -421,47 +421,44 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<span itemprop="image" t-attf-content="{{request.httprequest.url_root}}web/image/product.template/{{product.id}}/image" t-field="product.image" t-options="{'widget': 'image', 'class': 'product_detail_img', 'alt-field': 'name', 'zoom': 'image'}" groups="!website_sale.group_website_multi_image"/>
|
||||
<t groups="website_sale.group_website_multi_image">
|
||||
<t t-set="variant_img" t-value="any(product.mapped('product_variant_ids.image_variant'))"/>
|
||||
<t t-set="image_ids" t-value="product.product_image_ids"/>
|
||||
<div id="o-carousel-product" class="carousel slide" data-ride="carousel" data-interval="0">
|
||||
<div class="carousel-outer">
|
||||
<div class="carousel-inner">
|
||||
<div t-if="variant_img" class="item active" itemprop="image" t-field="product.product_variant_id.image" t-options="{'widget': 'image', 'class': 'product_detail_img js_variant_img', 'alt-field': 'name', 'zoom': 'image', 'unique': product['__last_update'] + (product.product_variant_id['__last_update'] or '')}"/>
|
||||
<div t-attf-class="item#{'' if variant_img else ' active'}" itemprop="image" t-field="product.image" t-options="{'widget': 'image', 'class': 'product_detail_img', 'alt-field': 'name', 'zoom': 'image', 'unique': product['__last_update']}"/>
|
||||
<t t-if="len(image_ids)" t-foreach="image_ids" t-as="pimg">
|
||||
<div class="item" t-field="pimg.image" t-options='{"widget": "image", "class": "product_detail_img", "alt-field": "name", "zoom": "image" }'/>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<t t-if="len(image_ids) or variant_img">
|
||||
<a class="carousel-control left" href="#o-carousel-product" role="button" data-slide="prev" >
|
||||
<span class="fa fa-chevron-left" aria-hidden="true"/>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control right" href="#o-carousel-product" role="button" data-slide="next">
|
||||
<span class="fa fa-chevron-right" aria-hidden="true"/>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<ol class="carousel-indicators" t-if="len(image_ids) or variant_img">
|
||||
<li t-if="variant_img" data-target="#o-carousel-product" data-slide-to="0" class="active">
|
||||
<img class="img img-responsive js_variant_img_small" t-attf-src="/website/image/product.product/{{product.product_variant_id.id}}/image/90x90" t-att-alt="product.name"/>
|
||||
</li>
|
||||
<li data-target="#o-carousel-product" t-att-data-slide-to="1 if variant_img else 0" t-att-class="'' if variant_img else 'active'">
|
||||
<img class="img img-responsive" t-attf-src="/website/image/product.template/{{product.id}}/image/90x90" t-att-alt="product.name"/>
|
||||
</li>
|
||||
<t t-set="variant_img" t-value="any(product.mapped('product_variant_ids.image_variant'))"/>
|
||||
<t t-set="image_ids" t-value="product.product_image_ids"/>
|
||||
<div id="o-carousel-product" class="carousel slide" data-ride="carousel" data-interval="0">
|
||||
<div class="carousel-outer">
|
||||
<div class="carousel-inner">
|
||||
<div t-if="variant_img" class="item active" itemprop="image" t-field="product.product_variant_id.image" t-options="{'widget': 'image', 'class': 'product_detail_img js_variant_img', 'alt-field': 'name', 'zoom': 'image', 'unique': product['__last_update'] + (product.product_variant_id['__last_update'] or '')}"/>
|
||||
<div t-attf-class="item#{'' if variant_img else ' active'}" itemprop="image" t-field="product.image" t-options="{'widget': 'image', 'class': 'product_detail_img', 'alt-field': 'name', 'zoom': 'image', 'unique': product['__last_update']}"/>
|
||||
<t t-if="len(image_ids)" t-foreach="image_ids" t-as="pimg">
|
||||
<li data-target="#o-carousel-product" t-att-data-slide-to="pimg_index + (variant_img and 2 or 1)">
|
||||
<img class="img img-responsive" t-attf-src="/website/image/product.image/{{pimg.id}}/image/90x90" t-att-alt="pimg.name"/>
|
||||
</li>
|
||||
<div class="item" t-field="pimg.image" t-options='{"widget": "image", "class": "product_detail_img", "alt-field": "name", "zoom": "image" }'/>
|
||||
</t>
|
||||
</ol>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-if="len(image_ids) or variant_img">
|
||||
<a class="carousel-control left" href="#o-carousel-product" role="button" data-slide="prev" >
|
||||
<span class="fa fa-chevron-left" aria-hidden="true"/>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control right" href="#o-carousel-product" role="button" data-slide="next">
|
||||
<span class="fa fa-chevron-right" aria-hidden="true"/>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<ol class="carousel-indicators" t-if="len(image_ids) or variant_img">
|
||||
<li t-if="variant_img" data-target="#o-carousel-product" data-slide-to="0" class="active">
|
||||
<img class="img img-responsive js_variant_img_small" t-attf-src="/website/image/product.product/{{product.product_variant_id.id}}/image/90x90" t-att-alt="product.name"/>
|
||||
</li>
|
||||
<li data-target="#o-carousel-product" t-att-data-slide-to="1 if variant_img else 0" t-att-class="'' if variant_img else 'active'">
|
||||
<img class="img img-responsive" t-attf-src="/website/image/product.template/{{product.id}}/image/90x90" t-att-alt="product.name"/>
|
||||
</li>
|
||||
<t t-if="len(image_ids)" t-foreach="image_ids" t-as="pimg">
|
||||
<li data-target="#o-carousel-product" t-att-data-slide-to="pimg_index + (variant_img and 2 or 1)">
|
||||
<img class="img img-responsive" t-attf-src="/website/image/product.image/{{pimg.id}}/image/90x90" t-att-alt="pimg.name"/>
|
||||
</li>
|
||||
</t>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-4 col-lg-offset-1" id="product_details">
|
||||
<h1 itemprop="name" t-field="product.name">Product Name</h1>
|
||||
|
||||
Reference in New Issue
Block a user