+
diff --git a/addons/website_sale_stock/views/res_config_settings_views.xml b/addons/website_sale_stock/views/res_config_settings_views.xml
index 64b527e5b99..0ae5827bf36 100644
--- a/addons/website_sale_stock/views/res_config_settings_views.xml
+++ b/addons/website_sale_stock/views/res_config_settings_views.xml
@@ -6,27 +6,46 @@
res.config.settings
-
- Manage the inventory of your products and display their availability status on the website.
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+ Inventory
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Units
+
+
+
+
diff --git a/addons/website_sale_stock/views/website_sale_stock_templates.xml b/addons/website_sale_stock/views/website_sale_stock_templates.xml
index ece20a8d3ba..3650bcd8a90 100644
--- a/addons/website_sale_stock/views/website_sale_stock_templates.xml
+++ b/addons/website_sale_stock/views/website_sale_stock_templates.xml
@@ -3,7 +3,7 @@
- (line.product_uom_qty + (line.product_id.free_qty - line.product_id.cart_qty)) if line.product_id.type == 'product' and line.product_id.inventory_availability in ['always', 'threshold'] else None
+ (line.product_uom_qty + (line.product_id.free_qty - line.product_id.cart_qty)) if line.product_id.type == 'product' and not line.product_id.allow_out_of_stock_order else None
@@ -50,5 +50,4 @@
-
diff --git a/addons/website_sale_stock_product_configurator/views/product_configurator_templates.xml b/addons/website_sale_stock_product_configurator/views/product_configurator_templates.xml
index 57489de10d2..3e80fb116a2 100644
--- a/addons/website_sale_stock_product_configurator/views/product_configurator_templates.xml
+++ b/addons/website_sale_stock_product_configurator/views/product_configurator_templates.xml
@@ -2,7 +2,7 @@
- max(product.sudo().free_qty - product.cart_qty, 1) if handle_stock and product.type == "product" and product.inventory_availability in ["always", "threshold"] else None
+ max(product.sudo().free_qty - product.cart_qty, 1) if handle_stock and product.type == "product" and not product.allow_out_of_stock_order else None
diff --git a/addons/website_sale_stock_wishlist/__init__.py b/addons/website_sale_stock_wishlist/__init__.py
new file mode 100644
index 00000000000..8c67f893b37
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import models
+from . import controllers
diff --git a/addons/website_sale_stock_wishlist/__manifest__.py b/addons/website_sale_stock_wishlist/__manifest__.py
new file mode 100644
index 00000000000..833b9a6e2a3
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/__manifest__.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+{
+ 'name': 'Product Availability Notifications',
+ 'category': 'Website/Website',
+ 'summary': 'Notify the user when a product is back in stock',
+ 'description': """
+Allow the user to select if he wants to receive email notifications when a product of his wishlist gets back in stock.
+ """,
+ 'depends': [
+ 'website_sale_stock',
+ 'website_sale_wishlist',
+ ],
+ 'data': [
+ 'views/templates.xml',
+ 'data/template_email.xml',
+ 'data/ir_cron_data.xml',
+ ],
+ 'assets': {
+ 'web.assets_frontend': [
+ 'website_sale_stock_wishlist/static/src/**/*',
+ ],
+ },
+ 'auto_install': True,
+ 'license': 'LGPL-3',
+}
diff --git a/addons/website_sale_stock_wishlist/controllers/__init__.py b/addons/website_sale_stock_wishlist/controllers/__init__.py
new file mode 100644
index 00000000000..6628b140058
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/controllers/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import main
+from . import variant
diff --git a/addons/website_sale_stock_wishlist/controllers/main.py b/addons/website_sale_stock_wishlist/controllers/main.py
new file mode 100644
index 00000000000..0dab1295cfb
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/controllers/main.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from odoo import http
+from odoo.http import request
+from odoo.addons.website_sale.controllers.main import WebsiteSale
+
+
+class WebsiteSaleStockWishlist(WebsiteSale):
+ @http.route(['/shop/wishlist/notify/'], type='json', auth="public", website=True)
+ def notify_stock(self, wish, notify=True, **kw):
+ if not request.website.is_public_user():
+ wish['stock_notification'] = notify
+ return wish['stock_notification']
diff --git a/addons/website_sale_stock_wishlist/controllers/variant.py b/addons/website_sale_stock_wishlist/controllers/variant.py
new file mode 100644
index 00000000000..0b9b1684392
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/controllers/variant.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import http
+from odoo.addons.website_sale.controllers.variant import WebsiteSaleVariantController
+
+
+class WebsiteSaleStockWishlistVariantController(WebsiteSaleVariantController):
+ @http.route()
+ def get_combination_info_website(self, product_template_id, product_id, combination, add_qty, **kw):
+ kw['context'] = kw.get('context', {})
+ kw['context'].update(website_sale_stock_wishlist_get_wish=True)
+ return super().get_combination_info_website(product_template_id, product_id, combination, add_qty, **kw)
diff --git a/addons/website_sale_stock_wishlist/data/ir_cron_data.xml b/addons/website_sale_stock_wishlist/data/ir_cron_data.xml
new file mode 100644
index 00000000000..dfb61dd7473
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/data/ir_cron_data.xml
@@ -0,0 +1,13 @@
+
+
+
+ Wishlist: send email regarding products availability
+ 1
+ hours
+ -1
+
+
+ model._send_availability_email()
+ code
+
+
diff --git a/addons/website_sale_stock_wishlist/data/template_email.xml b/addons/website_sale_stock_wishlist/data/template_email.xml
new file mode 100644
index 00000000000..7dfc2bc3c28
--- /dev/null
+++ b/addons/website_sale_stock_wishlist/data/template_email.xml
@@ -0,0 +1,26 @@
+
+
+
+