diff --git a/website_decimal_quantity/README.rst b/website_decimal_quantity/README.rst new file mode 100644 index 000000000..cec2570e2 --- /dev/null +++ b/website_decimal_quantity/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Website Decimal Quantity +======================== +This Module Allows Customers to Set Website-Shop Product Quantities in Decimal. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html ) + +Credits +------- +Developer: (v17) SANEEN K @ cybrosys, + (v18) Nivedhya T +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/website_decimal_quantity/__init__.py b/website_decimal_quantity/__init__.py new file mode 100644 index 000000000..512819c2d --- /dev/null +++ b/website_decimal_quantity/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/website_decimal_quantity/__manifest__.py b/website_decimal_quantity/__manifest__.py new file mode 100644 index 000000000..c1d3e272f --- /dev/null +++ b/website_decimal_quantity/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Website Decimal Quantity', + 'version': '18.0.1.0.0', + 'category': 'Website', + 'summary': 'The app allows to select quantity in decimal for products ' + 'in Website/Shop', + 'description': """The app enables users to select quantities in decimal + values for products within the Website/Shop interface.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website_sale'], + 'data': [ + ], + 'assets': { + 'web.assets_frontend': [ + '/website_decimal_quantity/static/src/js/website_sale.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_decimal_quantity/controllers/__init__.py b/website_decimal_quantity/controllers/__init__.py new file mode 100644 index 000000000..f95eac6e1 --- /dev/null +++ b/website_decimal_quantity/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import main +from . import website_sale_product_configurator diff --git a/website_decimal_quantity/controllers/main.py b/website_decimal_quantity/controllers/main.py new file mode 100644 index 000000000..d768276b0 --- /dev/null +++ b/website_decimal_quantity/controllers/main.py @@ -0,0 +1,216 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields +from odoo import http +from odoo.http import request +from werkzeug.exceptions import NotFound +from odoo.tools.json import scriptsafe as json_scriptsafe +from odoo.addons.payment import utils as payment_utils +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class WebsiteSaleDecimal(WebsiteSale): + """ + WebsiteSaleDecimal extends WebsiteSale class to update the methods: cart, + cart_update, cart_update_json and cart_quantity. + """ + + @http.route() + def cart(self, access_token=None, revive='', **post): + """ + Main cart management + abandoned cart revival + access_token: Abandoned cart SO access token + revive: Revival method when abandoned cart. Can be 'merge' or 'squash' + """ + order = request.website.sale_get_order() + if order and order.carrier_id: + # Express checkout is based on the amout of the sale order. If there is already a + # delivery line, Express Checkout form will display and compute the price of the + # delivery two times (One already computed in the total amount of the SO and one added + # in the form while selecting the delivery carrier) + order._remove_delivery_line() + if order and order.state != 'draft': + request.session['sale_order_id'] = None + order = request.website.sale_get_order() + + request.session['website_sale_cart_quantity'] = round( + sum(order.mapped('website_order_line.product_uom_qty')), 1) + + values = {} + if access_token: + abandoned_order = request.env['sale.order'].sudo().search( + [('access_token', '=', access_token)], limit=1) + if not abandoned_order: # wrong token (or SO has been deleted) + raise NotFound() + if abandoned_order.state != 'draft': # abandoned cart already finished + values.update({'abandoned_proceed': True}) + elif revive == 'squash' or ( + revive == 'merge' and not request.session.get( + 'sale_order_id')): # restore old cart or merge with unexistant + request.session['sale_order_id'] = abandoned_order.id + return request.redirect('/shop/cart') + elif revive == 'merge': + abandoned_order.order_line.write( + {'order_id': request.session['sale_order_id']}) + abandoned_order.action_cancel() + elif abandoned_order.id != request.session.get( + 'sale_order_id'): # abandoned cart found, user have to choose what to do + values.update({'access_token': abandoned_order.access_token}) + + values.update({ + 'website_sale_order': order, + 'date': fields.Date.today(), + 'suggested_products': [], + }) + if order: + order.order_line.filtered( + lambda l: not l.product_id.active).unlink() + values['suggested_products'] = order._cart_accessories() + values.update(self._get_express_shop_payment_values(order)) + + values.update(self._cart_values(**post)) + return request.render("website_sale.cart", values) + + @http.route() + def cart_update( + self, product_id, add_qty=1, set_qty=0, + product_custom_attribute_values=None, + no_variant_attribute_values=None, + express=False, **kwargs + ): + """This route is called when adding a product to cart (no options).""" + sale_order = request.website.sale_get_order(force_create=True) + if sale_order.state != 'draft': + request.session['sale_order_id'] = None + sale_order = request.website.sale_get_order(force_create=True) + + if product_custom_attribute_values: + product_custom_attribute_values = json_scriptsafe.loads( + product_custom_attribute_values) + + if no_variant_attribute_values: + no_variant_attribute_values = json_scriptsafe.loads( + no_variant_attribute_values) + + sale_order._cart_update( + product_id=int(product_id), + add_qty=add_qty, + set_qty=set_qty, + product_custom_attribute_values=product_custom_attribute_values, + no_variant_attribute_values=no_variant_attribute_values, + **kwargs + ) + + request.session[ + 'website_sale_cart_quantity'] = round( + sum(sale_order.mapped('website_order_line.product_uom_qty')), 1) + + if express: + return request.redirect("/shop/checkout?express=1") + return request.redirect("/shop/cart") + + @http.route() + def cart_update_json( + self, product_id, line_id=None, add_qty=None, set_qty=None, + display=True, + product_custom_attribute_values=None, + no_variant_attribute_values=None, **kw + ): + """ + This route is called : + - When changing quantity from the cart. + - When adding a product from the wishlist. + - When adding a product to cart on the same page (without redirection). + """ + order = request.website.sale_get_order(force_create=True) + if order.state != 'draft': + request.website.sale_reset() + if kw.get('force_create'): + order = request.website.sale_get_order(force_create=True) + else: + return {} + + if product_custom_attribute_values: + product_custom_attribute_values = json_scriptsafe.loads( + product_custom_attribute_values) + + if no_variant_attribute_values: + no_variant_attribute_values = json_scriptsafe.loads( + no_variant_attribute_values) + + values = order._cart_update( + product_id=product_id, + line_id=line_id, + add_qty=add_qty, + set_qty=set_qty, + product_custom_attribute_values=product_custom_attribute_values, + no_variant_attribute_values=no_variant_attribute_values, + **kw + ) + + values['notification_info'] = self._get_cart_notification_information( + order, [values['line_id']]) + values['notification_info']['warning'] = values.pop('warning', '') + request.session['website_sale_cart_quantity'] = round( + sum(order.mapped('website_order_line.product_uom_qty')), 1) + + if not order.cart_quantity: + request.website.sale_reset() + return values + + values['cart_quantity'] = round( + sum(order.mapped('website_order_line.product_uom_qty')), 1) + values['minor_amount'] = payment_utils.to_minor_currency_units( + order.amount_total, order.currency_id + ), + values['amount'] = order.amount_total + + if not display: + return values + + values['cart_ready'] = order._is_cart_ready() + values['website_sale.cart_lines'] = request.env[ + 'ir.ui.view']._render_template( + "website_sale.cart_lines", { + 'website_sale_order': order, + 'date': fields.Date.today(), + 'suggested_products': order._cart_accessories() + } + ) + values['website_sale.total'] = request.env[ + 'ir.ui.view']._render_template( + "website_sale.total", { + 'website_sale_order': order, + } + ) + return values + + @http.route() + def cart_quantity(self): + """ + This method updates the cart quantity count in the session based on + the order's website order lines. + """ + if 'website_sale_cart_quantity' not in request.session: + return request.website.sale_get_order().mapped( + 'website_order_line.product_uom_qty') + return request.session['website_sale_cart_quantity'] diff --git a/website_decimal_quantity/controllers/website_sale_product_configurator.py b/website_decimal_quantity/controllers/website_sale_product_configurator.py new file mode 100644 index 000000000..1a22eec28 --- /dev/null +++ b/website_decimal_quantity/controllers/website_sale_product_configurator.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +from odoo import http +from odoo.http import request,route +from odoo.addons.website_sale.controllers.product_configurator import WebsiteSaleProductConfiguratorController + +class WebsiteSaleDecimal(WebsiteSaleProductConfiguratorController): + + @route() + def website_sale_product_configurator_update_cart( + self, main_product, optional_products, **kwargs): + """ Add the provided main and optional products to the cart. + + Main and optional products have the following shape: + ``` + { + 'product_id': int, + 'product_template_id': int, + 'parent_product_template_id': int, + 'quantity': float, + 'product_custom_attribute_values': list(dict), + 'no_variant_attribute_value_ids': list(int), + } + ``` + + Note: if product A is a parent of product B, then product A must come before product B in + the optional_products list. Otherwise, the corresponding order lines won't be linked. + + :param dict main_product: The main product to add. + :param list(dict) optional_products: The optional products to add. + :param dict kwargs: Locally unused data passed to `_cart_update`. + :rtype: dict + :return: A dict containing information about the cart update. + """ + order_sudo = request.website.sale_get_order(force_create=True) + if order_sudo.state != 'draft': + request.session['sale_order_id'] = None + order_sudo = request.website.sale_get_order(force_create=True) + values = order_sudo._cart_update( + product_id=main_product['product_id'], + add_qty=float(main_product['quantity']), # Ensure quantity is float + product_custom_attribute_values=main_product['product_custom_attribute_values'], + no_variant_attribute_value_ids=[ + int(value_id) for value_id in main_product['no_variant_attribute_value_ids'] + ], + **kwargs, + ) + line_ids = {main_product['product_template_id']: values['line_id']} + + if optional_products and values['line_id']: + for option in optional_products: + option_values = order_sudo._cart_update( + product_id=option['product_id'], + add_qty=float(option['quantity']), # Ensure quantity is float + product_custom_attribute_values=option['product_custom_attribute_values'], + no_variant_attribute_value_ids=[ + int(value_id) for value_id in option['no_variant_attribute_value_ids'] + ], + linked_line_id=line_ids[option['parent_product_template_id']], + **kwargs, + ) + line_ids[option['product_template_id']] = option_values['line_id'] + + values['notification_info'] = self._get_cart_notification_information( + order_sudo, line_ids.values() + ) + values['cart_quantity'] = order_sudo.cart_quantity + request.session['website_sale_cart_quantity'] = order_sudo.cart_quantity + return values \ No newline at end of file diff --git a/website_decimal_quantity/doc/RELEASE_NOTES.md b/website_decimal_quantity/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..0ca69d032 --- /dev/null +++ b/website_decimal_quantity/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 12.11.2024 +#### Version 18.0.1.0.0 +#### ADD +- Initial Commit for Website Decimal Quantity. diff --git a/website_decimal_quantity/models/__init__.py b/website_decimal_quantity/models/__init__.py new file mode 100644 index 000000000..3ea6230e5 --- /dev/null +++ b/website_decimal_quantity/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import sale_order diff --git a/website_decimal_quantity/models/sale_order.py b/website_decimal_quantity/models/sale_order.py new file mode 100644 index 000000000..a6f500660 --- /dev/null +++ b/website_decimal_quantity/models/sale_order.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, models, _ +from odoo.exceptions import UserError +from odoo.http import request + + +class SaleOrder(models.Model): + """Inherit the 'sale.order' model to overwrite the _compute_cart_info + and _cart_update functions.""" + _inherit = 'sale.order' + + @api.depends('order_line.product_uom_qty', 'order_line.product_id') + def _compute_cart_info(self): + """ + Making cart_quantity integer is avoided in order + to represent it in decimal values + """ + for order in self: + order.cart_quantity = sum(order.mapped + ('website_order_line.product_uom_qty')) + order.only_services = all( + line.product_id.type == 'service' for line in + order.website_order_line) + + def _cart_update(self, product_id, line_id=None, add_qty=0, set_qty=0, + **kwargs): + """ Add or set product quantity, add_qty can be negative. + + Making add_qty and set_qty integer are avoided in order + to represent them as decimal values. + """ + self.ensure_one() + if self.state != 'draft': + request.session.pop('sale_order_id', None) + request.session.pop('website_sale_cart_quantity', None) + raise UserError(_('It is forbidden to modify a sales order ' + 'which is not in draft status.')) + product = self.env['product.product'].browse(product_id).exists() + if not product or not product._is_add_to_cart_allowed(): + raise UserError(_("The given product does not exist " + "therefore it cannot be added to cart.")) + if product.lst_price == 0 and \ + product.website_id.prevent_zero_price_sale: + raise UserError(_("The given product does not have a price " + "therefore it cannot be added to cart.")) + if line_id is not False: + order_line = self._cart_find_product_line(product_id, + line_id, **kwargs)[:1] + else: + order_line = self.env['sale.order.line'] + try: + if add_qty: + pass + except ValueError: + add_qty = 1 + try: + if set_qty: + pass + except ValueError: + set_qty = 0 + quantity = 0 + if set_qty: + quantity = set_qty + elif add_qty is not None: + if order_line: + quantity = int(order_line.product_uom_qty) + int(add_qty or 0) + else: + quantity = add_qty or 0 + if float(quantity) > 0: + quantity, warning = self._verify_updated_quantity( + order_line, + product_id, + float(quantity), + **kwargs, + ) + + else: + # If the line will be removed anyway, there is no need to verify + # the requested quantity update. + warning = '' + if order_line and int(quantity) <= 0: + # Remove zero or negative lines + order_line.unlink() + order_line = self.env['sale.order.line'] + elif order_line: + # Update existing line + update_values = self._prepare_order_line_update_values( + order_line, quantity, **kwargs) + if update_values: + self._update_cart_line_values(order_line, update_values) + elif int(quantity) >= 0: + # Create new line + order_line_values = self._prepare_order_line_values( + product_id, quantity, **kwargs) + order_line = self.env['sale.order.line'].sudo().create( + order_line_values) + return { + 'line_id': order_line.id, + 'quantity': quantity, + 'option_ids': list(set(order_line.linked_line_ids.filtered( + lambda sol: sol.order_id == order_line.order_id).ids)), + 'warning': warning, + } \ No newline at end of file diff --git a/website_decimal_quantity/static/description/assets/cybro-icon.png b/website_decimal_quantity/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/website_decimal_quantity/static/description/assets/cybro-icon.png differ diff --git a/website_decimal_quantity/static/description/assets/cybro-odoo.png b/website_decimal_quantity/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/cybro-odoo.png differ diff --git a/website_decimal_quantity/static/description/assets/h2.png b/website_decimal_quantity/static/description/assets/h2.png new file mode 100755 index 000000000..0bfc4707d Binary files /dev/null and b/website_decimal_quantity/static/description/assets/h2.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/arrows-repeat.svg b/website_decimal_quantity/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-1.png b/website_decimal_quantity/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/banner-1.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/banner-2.svg b/website_decimal_quantity/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-bg.png b/website_decimal_quantity/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/banner-bg.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/banner-bg.svg b/website_decimal_quantity/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-call.svg b/website_decimal_quantity/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-mail.svg b/website_decimal_quantity/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-pattern.svg b/website_decimal_quantity/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/banner-promo.svg b/website_decimal_quantity/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/brand-pair.svg b/website_decimal_quantity/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/check.png b/website_decimal_quantity/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/check.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/chevron.png b/website_decimal_quantity/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/chevron.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/close-icon.svg b/website_decimal_quantity/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/cogs.png b/website_decimal_quantity/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/cogs.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/collabarate-icon.svg b/website_decimal_quantity/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_decimal_quantity/static/description/assets/icons/consultation.png b/website_decimal_quantity/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/consultation.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/cybro-logo.png b/website_decimal_quantity/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/cybro-logo.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/down.svg b/website_decimal_quantity/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/website_decimal_quantity/static/description/assets/icons/ecom-black.png b/website_decimal_quantity/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/ecom-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/education-black.png b/website_decimal_quantity/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/education-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/faq.png b/website_decimal_quantity/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/faq.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/feature-icon.svg b/website_decimal_quantity/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/feature.png b/website_decimal_quantity/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/feature.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/gear.svg b/website_decimal_quantity/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/hero.gif b/website_decimal_quantity/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..f191cc048 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/hero.gif differ diff --git a/website_decimal_quantity/static/description/assets/icons/hire-odoo.svg b/website_decimal_quantity/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/hotel-black.png b/website_decimal_quantity/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/hotel-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/license.png b/website_decimal_quantity/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/license.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/life-ring-icon.svg b/website_decimal_quantity/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/lifebuoy.png b/website_decimal_quantity/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/lifebuoy.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/mail.svg b/website_decimal_quantity/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_decimal_quantity/static/description/assets/icons/manufacturing-black.png b/website_decimal_quantity/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/notes.png b/website_decimal_quantity/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/notes.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/notification icon.svg b/website_decimal_quantity/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/odoo-consultancy.svg b/website_decimal_quantity/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/odoo-licencing.svg b/website_decimal_quantity/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_decimal_quantity/static/description/assets/icons/odoo-logo.png b/website_decimal_quantity/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/odoo-logo.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/patter.svg b/website_decimal_quantity/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/pattern1.png b/website_decimal_quantity/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/pattern1.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/pos-black.png b/website_decimal_quantity/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/pos-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/puzzle-piece-icon.svg b/website_decimal_quantity/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/puzzle.png b/website_decimal_quantity/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/puzzle.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/replace-icon.svg b/website_decimal_quantity/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/restaurant-black.png b/website_decimal_quantity/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/restaurant-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/screenshot-main.png b/website_decimal_quantity/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/screenshot-main.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/screenshot.png b/website_decimal_quantity/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/screenshot.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/service-black.png b/website_decimal_quantity/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/service-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/skype-fill.svg b/website_decimal_quantity/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/skype.png b/website_decimal_quantity/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/skype.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/skype.svg b/website_decimal_quantity/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_decimal_quantity/static/description/assets/icons/star-1.svg b/website_decimal_quantity/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/star-2.svg b/website_decimal_quantity/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/support.png b/website_decimal_quantity/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/support.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/test-1 - Copy.png b/website_decimal_quantity/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/test-1 - Copy.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/test-1.png b/website_decimal_quantity/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/test-1.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/test-2.png b/website_decimal_quantity/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/test-2.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/trading-black.png b/website_decimal_quantity/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/trading-black.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/training.png b/website_decimal_quantity/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/training.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/translate.svg b/website_decimal_quantity/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/update.png b/website_decimal_quantity/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/update.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/user.png b/website_decimal_quantity/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/user.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/video.png b/website_decimal_quantity/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/video.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/whatsapp.png b/website_decimal_quantity/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/whatsapp.png differ diff --git a/website_decimal_quantity/static/description/assets/icons/wrench-icon.svg b/website_decimal_quantity/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/website_decimal_quantity/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_decimal_quantity/static/description/assets/icons/wrench.png b/website_decimal_quantity/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_decimal_quantity/static/description/assets/icons/wrench.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b1.png b/website_decimal_quantity/static/description/assets/modules/b1.png new file mode 100644 index 000000000..66765b17a Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b1.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b2.png b/website_decimal_quantity/static/description/assets/modules/b2.png new file mode 100644 index 000000000..e03a55991 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b2.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b3.png b/website_decimal_quantity/static/description/assets/modules/b3.png new file mode 100644 index 000000000..e03a55991 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b3.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b4.png b/website_decimal_quantity/static/description/assets/modules/b4.png new file mode 100644 index 000000000..efb8772d9 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b4.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b5.png b/website_decimal_quantity/static/description/assets/modules/b5.png new file mode 100644 index 000000000..f51e30182 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b5.png differ diff --git a/website_decimal_quantity/static/description/assets/modules/b6.png b/website_decimal_quantity/static/description/assets/modules/b6.png new file mode 100644 index 000000000..908adf794 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/modules/b6.png differ diff --git a/website_decimal_quantity/static/description/assets/screenshots/s1.png b/website_decimal_quantity/static/description/assets/screenshots/s1.png new file mode 100644 index 000000000..d6a0c0f56 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/screenshots/s1.png differ diff --git a/website_decimal_quantity/static/description/assets/screenshots/s2.png b/website_decimal_quantity/static/description/assets/screenshots/s2.png new file mode 100644 index 000000000..e7cc5fc78 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/screenshots/s2.png differ diff --git a/website_decimal_quantity/static/description/assets/screenshots/s3.png b/website_decimal_quantity/static/description/assets/screenshots/s3.png new file mode 100644 index 000000000..2ee9da5c6 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/screenshots/s3.png differ diff --git a/website_decimal_quantity/static/description/assets/y18.jpg b/website_decimal_quantity/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/website_decimal_quantity/static/description/assets/y18.jpg differ diff --git a/website_decimal_quantity/static/description/banner.png b/website_decimal_quantity/static/description/banner.png new file mode 100644 index 000000000..57619c099 Binary files /dev/null and b/website_decimal_quantity/static/description/banner.png differ diff --git a/website_decimal_quantity/static/description/icon.png b/website_decimal_quantity/static/description/icon.png new file mode 100644 index 000000000..2fbd1238f Binary files /dev/null and b/website_decimal_quantity/static/description/icon.png differ diff --git a/website_decimal_quantity/static/description/index.html b/website_decimal_quantity/static/description/index.html new file mode 100644 index 000000000..b4ea6916a --- /dev/null +++ b/website_decimal_quantity/static/description/index.html @@ -0,0 +1,921 @@ + + + + + + Website Decimal Quantity + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ In the Website/Shop Interface, Users have the + Capability to Specify Product Quantities Using Decimal + Values rather than being Limited to Whole Numbers. +

+

Website Decimal Quantity +

+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+

Key + Highlights

+
+
+
+
+ +
+
+
+

+ Allows to Select Quantity in Decimal for Products in Website.

+
+
+
+
+
+ +
+
+
+

+ Allows Users to Select Product in Decimal + Quantities from Product and Cart Page in Website/Shop. +

+
+
+
+
+
+ +
+
+
+

+ Simultaneous Price Calculation in the Cart + According to the Selected Decimal Quantities. +

+
+
+
+ +
+
+
+ Website Decimal Quantity +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Decimal Product Quantity in + + Product Page. +

+
+
+

+

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Decimal Product Quantity in + + Cart Page. +

+
+
+

+

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Simultaneous Price + + Calculation in Cart. +

+
+
+

+

+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+

+ Allows to Select Quantity in Decimal for Products in Website.

+
+ +
+
+
+
+
+
+ +
+

+ Allows Users to Select Product in Decimal + Quantities from Product and Cart Page in Website/Shop.

+
+
+
+
+
+
+
+ +
+

+ Simultaneous Price Calculation in the Cart + According to the Selected Decimal Quantities.

+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+

+ Pricing for decimal quantities + is handled based on your price + computation rules. If you set unit + prices for products that support decimals, + Odoo will calculate the price accordingly + based on the fractional quantity + selected by the customer. +

+
+
+ +
+ +
+

+ Yes, if you use decimal + quantities in the Website/Shop interface, + the invoices generated for these orders + will reflect the fractional quantities + selected by the customers. +

+
+
+
+ +
+
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 12th November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/website_decimal_quantity/static/src/js/website_sale.js b/website_decimal_quantity/static/src/js/website_sale.js new file mode 100644 index 000000000..fc806cc34 --- /dev/null +++ b/website_decimal_quantity/static/src/js/website_sale.js @@ -0,0 +1,84 @@ +/** @odoo-module **/ + +import publicWidget from "@web/legacy/js/public/public_widget"; +import wSaleUtils from "@website_sale/js/website_sale_utils"; +import { rpc } from "@web/core/network/rpc"; +import { Component } from "@odoo/owl"; + + +publicWidget.registry.WebsiteSale.include({ + /** +* This module extends the website_sale module to support decimal quantity input for adding products to the cart. +* It overrides the _onClickAddCartJSON function from sale.VariantMixin to add support for decimal quantity input, +* and extends the WebsiteSale widget to handle updating cart quantities when a decimal quantity is entered. +*/ + _onClickAddCartJSON(ev) { + ev.preventDefault(); + var $link = $(ev.currentTarget); + var $input = $link.closest('.input-group').find("input"); + var min = parseFloat($input.data("min") || 0); + var max = parseFloat($input.data("max") || Infinity); + var previousQty = parseFloat($input.val() || 0, 10); + var quantity = ($link.has(".fa-minus").length ? -0.1 : 0.1) + previousQty; + var newQt = quantity > min ? (quantity < max ? quantity : max) : min; + if (newQt !== previousQty) { + var newQty = newQt.toFixed(1); + $input.val(newQty).trigger('change'); + } + newQty = newQt.toFixed(1); + return false; + }, + /** Override the function _changeCartQuantity for changing the cart quantity **/ + _changeCartQuantity: function ($input, value, $dom_optional, line_id, productIDs) { + $($dom_optional).toArray().forEach((elem) => { + + $(elem).find('.js_quantity').text(value); + productIDs.push($(elem).find('span[data-product-id]').data('product-id')); + }); + $input.data('update_change', true); + + rpc("/shop/cart/update_json", { + line_id: line_id, + product_id: parseInt($input.data('product-id'), 10), + set_qty: value, + display: true, + }).then((data) => { + $input.data('update_change', false); + var check_value = parseFloat($input.val()); + if (isNaN(check_value)) { + check_value = 1; + } + if (value !== check_value) { + $input.trigger('change'); + return; + } + if (!data.cart_quantity) { + return window.location = '/shop/cart'; + } + $input.val(data.quantity); + $('.js_quantity[data-line-id='+line_id+']').val(data.quantity).text(data.quantity); + + wSaleUtils.updateCartNavBar(data); + wSaleUtils.showWarning(data.notification_info.warning); + // Propagating the change to the express checkout forms + Component.env.bus.trigger('cart_amount_changed', [data.amount, data.minor_amount]); + }); + }, +/** Override the function _onChangeCartQuantity **/ + _onChangeCartQuantity: function (ev) { + ev.preventDefault(); + var $input = $(ev.currentTarget); + if ($input.data('update_change')) { + return; + } + var value = parseFloat($input.val() || 0, 10); + if (isNaN(value)) { + value = 1; + } + var $dom = $input.closest('tr'); + var $dom_optional = $dom.nextUntil(':not(.optional_product.info)'); + var line_id = parseInt($input.data('line-id'), 10); + var productIDs = [parseInt($input.data('product-id'), 10)]; + this._changeCartQuantity($input, value, $dom_optional, line_id, productIDs); + }, +});