From 40fa7227823aa70b19e601c5c73e7f721814812e Mon Sep 17 00:00:00 2001 From: docker-odoo Date: Thu, 10 Oct 2024 15:44:02 +0000 Subject: [PATCH] [MIG] website_sale_ux: Migration to 18.0 closes ingadhoc/website#330 Signed-off-by: matiasperalta1 --- website_sale_ux/README.rst | 12 +++----- website_sale_ux/__init__.py | 1 - website_sale_ux/__manifest__.py | 4 +-- website_sale_ux/controllers/__init__.py | 5 ---- website_sale_ux/controllers/main.py | 29 ------------------- website_sale_ux/views/ecommerce_fields.xml | 3 -- .../views/product_template_views.xml | 11 +++++-- website_sale_ux/views/snippets.xml | 6 ---- website_sale_ux/views/templates.xml | 9 ------ 9 files changed, 14 insertions(+), 66 deletions(-) delete mode 100644 website_sale_ux/controllers/__init__.py delete mode 100644 website_sale_ux/controllers/main.py diff --git a/website_sale_ux/README.rst b/website_sale_ux/README.rst index d6d9978b..3ef80ff2 100644 --- a/website_sale_ux/README.rst +++ b/website_sale_ux/README.rst @@ -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 ============ diff --git a/website_sale_ux/__init__.py b/website_sale_ux/__init__.py index 729ea494..d0337769 100644 --- a/website_sale_ux/__init__.py +++ b/website_sale_ux/__init__.py @@ -2,5 +2,4 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from . import controllers from . import models diff --git a/website_sale_ux/__manifest__.py b/website_sale_ux/__manifest__.py index 23528314..887d38eb 100644 --- a/website_sale_ux/__manifest__.py +++ b/website_sale_ux/__manifest__.py @@ -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', @@ -38,5 +38,5 @@ 'views/ecommerce_fields.xml', 'views/snippets.xml' ], - 'installable': False, + 'installable': True, } diff --git a/website_sale_ux/controllers/__init__.py b/website_sale_ux/controllers/__init__.py deleted file mode 100644 index 04298136..00000000 --- a/website_sale_ux/controllers/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################## -# For copyright and license notices, see __manifest__.py file in module root -# directory -############################################################################## -from . import main diff --git a/website_sale_ux/controllers/main.py b/website_sale_ux/controllers/main.py deleted file mode 100644 index 1102c967..00000000 --- a/website_sale_ux/controllers/main.py +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################## -# For copyright and license notices, see __manifest__.py file in module root -# directory -############################################################################## -from odoo.addons.sale_product_configurator.controllers.main import ProductConfiguratorController -from odoo.http import request - - -class ProductConfiguratorControllerCustom(ProductConfiguratorController): - - def _show_optional_products(self, product_id, variant_values, pricelist, handle_stock, **kw): - product = request.env['product.product'].browse(int(product_id)) - combination = request.env['product.template.attribute.value'].browse(variant_values) - - add_qty = int(kw.get('add_qty', 1)) - - no_variant_attribute_values = combination.filtered(lambda x: x.attribute_id.create_variant == 'no_variant') - if no_variant_attribute_values: - product = product.with_context(no_variant_attribute_values=no_variant_attribute_values) - - return request.env['ir.ui.view'].render_template("sale_product_configurator.optional_products_modal", { - 'product': product, - 'combination': combination, - 'add_qty': add_qty, - 'parent_name': product.name, - 'variant_values': variant_values, - 'pricelist': pricelist, - 'handle_stock': handle_stock, - }) diff --git a/website_sale_ux/views/ecommerce_fields.xml b/website_sale_ux/views/ecommerce_fields.xml index 7a2abaa3..07d17d1e 100644 --- a/website_sale_ux/views/ecommerce_fields.xml +++ b/website_sale_ux/views/ecommerce_fields.xml @@ -7,9 +7,6 @@ - - - diff --git a/website_sale_ux/views/product_template_views.xml b/website_sale_ux/views/product_template_views.xml index d15814f2..e01a64cb 100644 --- a/website_sale_ux/views/product_template_views.xml +++ b/website_sale_ux/views/product_template_views.xml @@ -15,7 +15,7 @@ product._website_show_quick_add() and len(product.product_variant_ids) == 1 - + @@ -23,8 +23,13 @@ diff --git a/website_sale_ux/views/snippets.xml b/website_sale_ux/views/snippets.xml index 6a4bd4c5..aaec1ad2 100644 --- a/website_sale_ux/views/snippets.xml +++ b/website_sale_ux/views/snippets.xml @@ -4,12 +4,6 @@ inherit_id="website_sale.snippet_options" name="description sale options" > - - - Complete purchase - - -