Skip to content

Commit

Permalink
[MIG] website_sale_ux: Migration to 18.0
Browse files Browse the repository at this point in the history
closes #330

Signed-off-by: matiasperalta1 <mnp@adhoc.com.ar>
  • Loading branch information
docker-odoo authored and JrAdhoc committed Dec 23, 2024
1 parent 401d8fd commit 40fa722
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 66 deletions.
12 changes: 4 additions & 8 deletions website_sale_ux/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ Website Sale UX
===============

#. This module adds the option to "Search Website Product Category for" (public_categ_ids) on Website app`s backend search bar (Website > Product).
#. This module also changes the functionality of the Catalog page`s "Add to cart" buttons (frontend):
* If the product has not variants, when user clicks Add to cart button then the product is added to the Cart (default behaviour).
* If the product has variants, when users click the Add to cart button then they are redirected to the Product page (new feature) so they could choice among all variants, instead of opening the pop-up to choice among all variants (default behaviour). This new feature is required because "variant pop-up" shows a malfunction when user tries to add to cart a bigger quantity of a variant product than stock available.
#. Rename "All products" to "All categories" in categories left snippet on shop
#. Adds an option to disable returning categories on shop search bar. To do so you need to go to website settings and check option "Disable Categories Search"
#. Rename "All products" to "All categories" in categories left snippet on shop.
#. Adds an option to disable returning categories on shop search bar. To do so you need to go to website settings and check option "Disable Categories Search".
#. Adds a button on the filters sidebar on ecommerce to get back to the shop page unapplying all filters previously set
#. Makes the native fields description_ecommerce and website_description visible on product.template backend view
#. A toggle button is added on website Builder for 'Product page' cutomization, called "Sale description". This button shows/hides the sale_description field on frontend view
#. Adds a toggle button on Website's Builder when user is editing on "/shop" page, to automatically display an "Out of stock" ribbon on the products's card when the product's available stock is zero. Additionally, it adds a class "out_of_stock_img_blur" which allows to set further customizations using the css editor
#. Makes the native field website_description visible on product.template backend view
#. Adds a toggle button on Website's Builder when user is editing on "/shop" page, to automatically display an "Out of stock" ribbon on the products's card when the product's available stock is zero. Additionally, it adds a class "out_of_stock_img_blur" which allows to set further customizations using the css editor.

Installation
============
Expand Down
1 change: 0 additions & 1 deletion website_sale_ux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import controllers
from . import models
4 changes: 2 additions & 2 deletions website_sale_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
'name': 'Website Sale UX',
'category': 'base.module_category_knowledge_management',
'version': "17.0.1.4.0",
'version': "18.0.1.0.0",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand All @@ -38,5 +38,5 @@
'views/ecommerce_fields.xml',
'views/snippets.xml'
],
'installable': False,
'installable': True,
}
5 changes: 0 additions & 5 deletions website_sale_ux/controllers/__init__.py

This file was deleted.

29 changes: 0 additions & 29 deletions website_sale_ux/controllers/main.py

This file was deleted.

3 changes: 0 additions & 3 deletions website_sale_ux/views/ecommerce_fields.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<field name="arch" type="xml">
<xpath expr="//group[@name='description']/.." position="after">
<group name="ecommerce_fields">
<group string="Ecommerce Description" name="ecommerce_description">
<field colspan="2" name="description_ecommerce" nolabel="1" placeholder="This note is only displayed in the ecommerce next to the product's image."/>
</group>
<group string="Ecommerce Detailed Description" name="ecommerce_detailed_description">
<field colspan="2" name="website_description" nolabel="1" placeholder="This note is only displayed in the ecommerce below the product's image."/>
</group>
Expand Down
11 changes: 8 additions & 3 deletions website_sale_ux/views/product_template_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@
<xpath expr="//a[@t-if='product._website_show_quick_add()']" position="attributes">
<attribute name="t-if">product._website_show_quick_add() and len(product.product_variant_ids) == 1</attribute>
</xpath>
<xpath expr="//a[hasclass('btn-primary')]/.." position="after">
<xpath expr="//a[hasclass('btn-light')]/.." position="after">
<a class="btn btn-secondary btn-m" title="Shopping cart (Select attributes)" t-if="len(product.product_variant_ids) &gt; 1" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']&gt;1 else None))">
<span class="fa fa-shopping-cart"/>
</a>
</xpath>
</template>

<template id="products_categories_list" inherit_id="website_sale.products_categories_list">
<xpath expr="//label[@t-att-for='all_products']" position="replace">
<label class="form-check-label fw-normal" t-att-for="'all_products'">All Categories</label>
<xpath expr="//a" position="replace">
<a
t-att-href="keep('/shop', category=0)"
t-attf-class="{{not category and 'text-decoration-underline'}} p-0"
>
All Categories
</a>
</xpath>
</template>
</odoo>
6 changes: 0 additions & 6 deletions website_sale_ux/views/snippets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
inherit_id="website_sale.snippet_options"
name="description sale options"
>
<xpath expr="//we-checkbox[@data-customize-website-views='website_sale.product_quantity']" position="before">
<we-checkbox string="Sale Description"
data-customize-website-views="website_sale_ux.new_description_sale"
data-no-preview="true"
data-reload="/"/>
</xpath>
<xpath expr="//we-checkbox[@data-customize-website-views='website_sale.products_description']" position="after">
<we-checkbox string="Out of stock Ribbon"
data-customize-website-views="website_sale_ux.out_of_stock_ribbon"
Expand Down
9 changes: 0 additions & 9 deletions website_sale_ux/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
<span>Complete purchase</span>
</xpath>
</template>
<template id="hide_description_sale" inherit_id="website_sale.product">
<xpath expr="//p[@t-field='product.description_sale']" position="replace">
<t t-if="is_view_active('website_sale_ux.new_description_sale')" t-call="website_sale_ux.new_description_sale" />
</xpath>
</template>

<template id="new_description_sale" active="False">
<p t-field="product.description_sale" class="text-muted my-2" placeholder="A short description that will also appear on documents."/>
</template>
<template id="out_of_stock_ribbon" inherit_id="website_sale.products_item" active="False">
<xpath expr="//t[@t-set='bg_class']" position="after">
<span t-if="product._is_sold_out() and not product.allow_out_of_stock_order" class="o_ribbon o_not_editable o_dirty o_tag_left out_of_stock_ribbon" style="color: var(--o-color-4); background-color:rgb(255, 0, 0)">Out of stock</span>
Expand Down

0 comments on commit 40fa722

Please sign in to comment.