diff --git a/pos_restrict_product_stock/README.rst b/pos_restrict_product_stock/README.rst new file mode 100644 index 000000000..c9b2331f9 --- /dev/null +++ b/pos_restrict_product_stock/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/licenses-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Display Stock in POS | Restrict Out-of-Stock Products in POS +============================================================= +This module enables you to limit the ordering of out-of-stock products in POS as well as display the available quantity for each product (on-hand quantity and virtual quantity) + +Configuration +============= +No additional configuration required + +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: + (V16) Raneesha M K, + (V17) Anjhana A K + (V18) Manasa T P +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/pos_restrict_product_stock/__init__.py b/pos_restrict_product_stock/__init__.py new file mode 100644 index 000000000..45a758aa4 --- /dev/null +++ b/pos_restrict_product_stock/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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 models diff --git a/pos_restrict_product_stock/__manifest__.py b/pos_restrict_product_stock/__manifest__.py new file mode 100644 index 000000000..0e5949a09 --- /dev/null +++ b/pos_restrict_product_stock/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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': 'Display Stock in POS | Restrict Out-of-Stock Products in POS', + 'version': '18.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Enhance your Point of Sale experience by preventing the + ordering of out-of-stock products during your session""", + 'description': """This module enables you to limit the ordering of + out-of-stock products in POS as well as display the available quantity for + each product (on-hand quantity and virtual quantity).""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale','pos_preparation_display'], + 'data': ['views/res_config_settings_views.xml'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_restrict_product_stock/static/src/js/ProductScreen.js', + 'pos_restrict_product_stock/static/src/js/OrderScreen.js', + 'pos_restrict_product_stock/static/src/css/display_stock.css', + 'pos_restrict_product_stock/static/src/xml/ProductItem.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_restrict_product_stock/doc/RELEASE_NOTES.md b/pos_restrict_product_stock/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..88ec29e5e --- /dev/null +++ b/pos_restrict_product_stock/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.06.2025 +#### Version 18.0.1.0.0 +#### ADD +- Initial Commit for Display Stock in POS | Restrict Out-of-Stock Products in POS diff --git a/pos_restrict_product_stock/models/__init__.py b/pos_restrict_product_stock/models/__init__.py new file mode 100644 index 000000000..b61291eb7 --- /dev/null +++ b/pos_restrict_product_stock/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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 product +from . import pos_config +from . import pos_session +from . import res_config_settings diff --git a/pos_restrict_product_stock/models/pos_config.py b/pos_restrict_product_stock/models/pos_config.py new file mode 100644 index 000000000..5dbca4f44 --- /dev/null +++ b/pos_restrict_product_stock/models/pos_config.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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, models + + +class PosConfig(models.Model): + """Inherited pos configuration setting for adding some + fields for restricting out-of stock""" + _inherit = 'pos.config' + + is_display_stock = fields.Boolean(string="Display Stock in POS", + help="Enable if you want to show " + "quantity of products") + is_restrict_product = fields.Boolean( + string="Restrict Product Out-of Stock in POS", + help="Enable if you want restrict of stock product from pos") + stock_type = fields.Selection([('qty_on_hand', 'Qty on Hand'), + ('virtual_qty', 'Virtual Qty'), + ('both', 'Both')], required=True, + default='qty_on_hand', string="Stock Type", + help="In which quantity type you" + " have to restrict and display") diff --git a/pos_restrict_product_stock/models/pos_session.py b/pos_restrict_product_stock/models/pos_session.py new file mode 100644 index 000000000..f5d402214 --- /dev/null +++ b/pos_restrict_product_stock/models/pos_session.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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 models + + +class PosSession(models.Model): + """Inherited pos session for loading quantity fields from product""" + _inherit = 'pos.session' + + def _loader_params_product_product(self): + """Load forcast and on hand quantity field to pos session. + :return dict: returns dictionary of field parameters for the + product model + """ + result = super()._loader_params_product_product() + result['search_params']['fields'].append('qty_available') + result['search_params']['fields'].append('virtual_available') + return result diff --git a/pos_restrict_product_stock/models/product.py b/pos_restrict_product_stock/models/product.py new file mode 100644 index 000000000..2ba5465ce --- /dev/null +++ b/pos_restrict_product_stock/models/product.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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 models + +class ProductProduct(models.Model): + _inherit = 'product.product' + + def _load_pos_data_fields(self, config_id): + """Extend to include qty_available and virtual_available in POS data fields.""" + fields = super(ProductProduct, self)._load_pos_data_fields(config_id) + if 'qty_available' not in fields: + fields.append('qty_available') + if 'virtual_available' not in fields: + fields.append('virtual_available') + return fields \ No newline at end of file diff --git a/pos_restrict_product_stock/models/res_config_settings.py b/pos_restrict_product_stock/models/res_config_settings.py new file mode 100644 index 000000000..c521ef2a7 --- /dev/null +++ b/pos_restrict_product_stock/models/res_config_settings.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Manasa T P() +# 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, models + + +class ResConfigSettings(models.TransientModel): + """Inherited res configuration setting for adding fields for + restricting out-of-stock products""" + _inherit = 'res.config.settings' + + is_display_stock = fields.Boolean(related="pos_config_id.is_display_stock", + string="Display Stock in POS", + readonly=False, + help="Enable if you want to show the " + "quantity of products.") + is_restrict_product = fields.Boolean( + related="pos_config_id.is_restrict_product", + string="Restrict Product Out of Stock in POS", readonly=False, + help="Enable if you want restrict of stock product from POS") + stock_type = fields.Selection(related="pos_config_id.stock_type", + string="Stock Type", readonly=False, + help="In which quantity type you" + "have to restrict and display in POS") diff --git a/pos_restrict_product_stock/static/description/assets/cybro-icon.png b/pos_restrict_product_stock/static/description/assets/cybro-icon.png new file mode 100755 index 000000000..06e73e11d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/cybro-icon.png differ diff --git a/pos_restrict_product_stock/static/description/assets/cybro-odoo.png b/pos_restrict_product_stock/static/description/assets/cybro-odoo.png new file mode 100755 index 000000000..ed02e07a4 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/cybro-odoo.png differ diff --git a/pos_restrict_product_stock/static/description/assets/h2.png b/pos_restrict_product_stock/static/description/assets/h2.png new file mode 100755 index 000000000..0bfc4707d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/h2.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/arrows-repeat.svg b/pos_restrict_product_stock/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-1.png b/pos_restrict_product_stock/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/banner-1.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-2.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-bg.png b/pos_restrict_product_stock/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/banner-bg.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-bg.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-call.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-mail.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-pattern.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/banner-promo.svg b/pos_restrict_product_stock/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/brand-pair.svg b/pos_restrict_product_stock/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/check.png b/pos_restrict_product_stock/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/check.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/chevron.png b/pos_restrict_product_stock/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/chevron.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/close-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/cogs.png b/pos_restrict_product_stock/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/cogs.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/collabarate-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/consultation.png b/pos_restrict_product_stock/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/consultation.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/cybro-logo.png b/pos_restrict_product_stock/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/cybro-logo.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/down.svg b/pos_restrict_product_stock/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pos_restrict_product_stock/static/description/assets/icons/ecom-black.png b/pos_restrict_product_stock/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/ecom-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/education-black.png b/pos_restrict_product_stock/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/education-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/faq.png b/pos_restrict_product_stock/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/faq.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/feature-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/feature.png b/pos_restrict_product_stock/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/feature.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/gear.svg b/pos_restrict_product_stock/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/hero.gif b/pos_restrict_product_stock/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..e15d80be8 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/hero.gif differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/hire-odoo.svg b/pos_restrict_product_stock/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/hotel-black.png b/pos_restrict_product_stock/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/hotel-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/license.png b/pos_restrict_product_stock/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/license.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/life-ring-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/lifebuoy.png b/pos_restrict_product_stock/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/mail.svg b/pos_restrict_product_stock/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/manufacturing-black.png b/pos_restrict_product_stock/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/notes.png b/pos_restrict_product_stock/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/notes.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/notification icon.svg b/pos_restrict_product_stock/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/odoo-consultancy.svg b/pos_restrict_product_stock/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/odoo-licencing.svg b/pos_restrict_product_stock/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/odoo-logo.png b/pos_restrict_product_stock/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/odoo-logo.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/patter.svg b/pos_restrict_product_stock/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/pattern1.png b/pos_restrict_product_stock/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/pattern1.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/pos-black.png b/pos_restrict_product_stock/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/pos-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/puzzle-piece-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/puzzle.png b/pos_restrict_product_stock/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/puzzle.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/replace-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/restaurant-black.png b/pos_restrict_product_stock/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/screenshot-main.png b/pos_restrict_product_stock/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/screenshot-main.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/screenshot.png b/pos_restrict_product_stock/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/screenshot.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/service-black.png b/pos_restrict_product_stock/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/service-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/skype-fill.svg b/pos_restrict_product_stock/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/skype.png b/pos_restrict_product_stock/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/skype.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/skype.svg b/pos_restrict_product_stock/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/star-1.svg b/pos_restrict_product_stock/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/star-2.svg b/pos_restrict_product_stock/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/support.png b/pos_restrict_product_stock/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/support.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/test-1 - Copy.png b/pos_restrict_product_stock/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/test-1 - Copy.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/test-1.png b/pos_restrict_product_stock/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/test-1.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/test-2.png b/pos_restrict_product_stock/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/test-2.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/trading-black.png b/pos_restrict_product_stock/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/trading-black.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/training.png b/pos_restrict_product_stock/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/training.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/translate.svg b/pos_restrict_product_stock/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/update.png b/pos_restrict_product_stock/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/update.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/user.png b/pos_restrict_product_stock/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/user.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/video.png b/pos_restrict_product_stock/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/video.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/whatsapp.png b/pos_restrict_product_stock/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/whatsapp.png differ diff --git a/pos_restrict_product_stock/static/description/assets/icons/wrench-icon.svg b/pos_restrict_product_stock/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/pos_restrict_product_stock/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_restrict_product_stock/static/description/assets/icons/wrench.png b/pos_restrict_product_stock/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/icons/wrench.png differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/1.jpg b/pos_restrict_product_stock/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/1.jpg differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/2.jpg b/pos_restrict_product_stock/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/2.jpg differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/3.jpg b/pos_restrict_product_stock/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/3.jpg differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/4.png b/pos_restrict_product_stock/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/4.png differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/5.jpg b/pos_restrict_product_stock/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/5.jpg differ diff --git a/pos_restrict_product_stock/static/description/assets/modules/6.gif b/pos_restrict_product_stock/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/modules/6.gif differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/1.png b/pos_restrict_product_stock/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..d40479b4f Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/1.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/10.png b/pos_restrict_product_stock/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..0feaae9d1 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/10.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/11.png b/pos_restrict_product_stock/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..741bc512c Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/11.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/12.png b/pos_restrict_product_stock/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..904340dab Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/12.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/2.png b/pos_restrict_product_stock/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..c6501f913 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/2.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/3.png b/pos_restrict_product_stock/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..cb600d8e8 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/3.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/4.png b/pos_restrict_product_stock/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..4dc57a740 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/4.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/5.png b/pos_restrict_product_stock/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..3a4056340 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/5.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/6.png b/pos_restrict_product_stock/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..499ce0f8d Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/6.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/7.png b/pos_restrict_product_stock/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..5f9d5c447 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/7.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/8.png b/pos_restrict_product_stock/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..e4391cddc Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/8.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/9.png b/pos_restrict_product_stock/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..25d0ab3b4 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/9.png differ diff --git a/pos_restrict_product_stock/static/description/assets/screenshots/v18_gif.gif b/pos_restrict_product_stock/static/description/assets/screenshots/v18_gif.gif new file mode 100644 index 000000000..e15d80be8 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/screenshots/v18_gif.gif differ diff --git a/pos_restrict_product_stock/static/description/assets/y18.jpg b/pos_restrict_product_stock/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/pos_restrict_product_stock/static/description/assets/y18.jpg differ diff --git a/pos_restrict_product_stock/static/description/banner.jpg b/pos_restrict_product_stock/static/description/banner.jpg new file mode 100644 index 000000000..c0cc9218d Binary files /dev/null and b/pos_restrict_product_stock/static/description/banner.jpg differ diff --git a/pos_restrict_product_stock/static/description/icon.png b/pos_restrict_product_stock/static/description/icon.png new file mode 100644 index 000000000..ed7fdd1ad Binary files /dev/null and b/pos_restrict_product_stock/static/description/icon.png differ diff --git a/pos_restrict_product_stock/static/description/index.html b/pos_restrict_product_stock/static/description/index.html new file mode 100644 index 000000000..5195427d7 --- /dev/null +++ b/pos_restrict_product_stock/static/description/index.html @@ -0,0 +1,1162 @@ + + + + + + Display Stock in POS | Restrict Out-of-Stock Products in POS + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ Restrict Out of Stock Product from PoS session + and Display the Stock +

+

Display Stock in POS | Restrict Out-of-Stock Products in + POS +

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

Key + Highlights

+
+
+
+
+ +
+
+ Real-Time Stock Visibility +
+

+ Instantly view on-hand and virtual + quantities of products directly within the + POS interface.

+
+
+
+
+
+ +
+
+ Restrict Out-of-Stock Product Sales +
+

+ Prevent users from adding unavailable + products to orders, ensuring you don't sell + items that are out of stock. +

+
+
+
+
+
+ +
+
+ Seamless POS Integration +
+

+ Fully integrated with Odoo POS, the module + enforces stock restrictions without + disrupting the ordering flow, improving + accuracy and inventory control. +

+
+
+
+
+ +
+
+
+ Display Stock in POS | Restrict Out-of-Stock Products in POS +

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

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

+ POS Settings + + +

+
+
+

+ Go to POS Settings -> Enable + Display Stock in POS and select + which type of quantity you have + to be visible in session. If you + want to restrict out of stock + products from ordering based on + the quantity type you selected. +

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

+ Show On Hand Quantity + + +

+
+
+

+ If the selected type is "on + hand" ,then on hand quantity can + be visible in left-top of + product item. +

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

+ + Confirmation for Adding Out of Stock Product + +

+
+
+

+ If the quantity of the product + is zero then it visible in + different color. If you try to + order out of stock product a + confirmation popup will render, + still + you want to order the product + then click order button. +

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

+ Add Out of Stock Product + +

+
+
+

+ The out-of-stock product is + added to orderline. +

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

+ Show Virtual Quantity in Product Screen + +

+
+
+

+ If you selected the "virtual + quantity" it will display in the + right-top of each product item. +

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

+ Show both On Hand and Virtual Quantity + +

+
+
+

+ If you select "both", then it + display both type of quantity. +

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

+ Displays Available and Virtual + Quantity +

+
+ +
+
+
+
+
+
+ +
+

+ Prevents Adding Out-of-Stock + Products +

+
+
+
+
+
+
+
+ +
+

+ Popup Warning for Out-of-Stock + Items when attempting to add + them.

+
+
+
+
+
+
+
+ +
+

+ Supports Real-Time Stock Updates + for accurate product + availability.

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

+ This module enhances + Odoo’s Point of Sale + by showing real-time + product availability + (on-hand and virtual + quantities) and + prevents selling + out-of-stock + items.

+
+
+ +
+ +
+

+ The available and + virtual quantities + are displayed + directly on the + product screen + within the POS + interface. +

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

+ Latest Release 18.0.1.0.0 +

+ + 11th June, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/pos_restrict_product_stock/static/src/css/display_stock.css b/pos_restrict_product_stock/static/src/css/display_stock.css new file mode 100644 index 000000000..43313a6b2 --- /dev/null +++ b/pos_restrict_product_stock/static/src/css/display_stock.css @@ -0,0 +1,29 @@ +.display_qty{ + background:#714B67; + position:absolute; + top:0; + left:0; + width:30px; + height:20px; + border-radius: 3px; + text-align:center; + font-weight: bold; + font-size: 14px; + color:white +} +.not-available{ + background: #808080; +} +.display_virtual{ + background:#017e84; + position:absolute; + top:0; + right:0; + width:30px; + height:20px; + border-radius: 3px; + text-align:center; + font-weight: bold; + font-size: 14px; + color:white +} diff --git a/pos_restrict_product_stock/static/src/js/OrderScreen.js b/pos_restrict_product_stock/static/src/js/OrderScreen.js new file mode 100644 index 000000000..6ee22321b --- /dev/null +++ b/pos_restrict_product_stock/static/src/js/OrderScreen.js @@ -0,0 +1,37 @@ +/** @odoo-module */ +import { PosStore } from "@point_of_sale/app/store/pos_store"; +import { patch } from "@web/core/utils/patch"; +import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { _t } from "@web/core/l10n/translation"; + + +patch(PosStore.prototype, { + async pay() { + var type = this.config.stock_type + const pay = true + const body = [] + const pro_id = false + for (const line of this.get_order().get_orderlines()) { + if (line.config.is_restrict_product && ((type == 'qty_on_hand') && (line.product_id.qty_available <= 0)) | ((type == 'virtual_qty') && (line.product_id.virtual_available <= 0)) | + ((line.product_id.qty_available <= 0) && (line.product_id.virtual_available <= 0))) { + // If the product restriction is activated in the settings and quantity is out stock, it show the restrict popup. + body.push(line.product_id.display_name) + } + } + if (body.length > 0) { // Check if body has items + const confirmed = this.dialog.add(ConfirmationDialog, { + body: _t("%s is out of stock. Click Order, if you still want to add this product?", body), + confirmLabel: _t("Order"), + confirm: () => { + return super.pay(); + }, + cancel: () => { + return; + }, + }) + } + else { + return super.pay(); // No restrictions, proceed with payment + } + } +}) diff --git a/pos_restrict_product_stock/static/src/js/ProductScreen.js b/pos_restrict_product_stock/static/src/js/ProductScreen.js new file mode 100644 index 000000000..c3c8976c0 --- /dev/null +++ b/pos_restrict_product_stock/static/src/js/ProductScreen.js @@ -0,0 +1,34 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { useService } from "@web/core/utils/hooks"; +import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { _t } from "@web/core/l10n/translation"; + + +patch(ProductScreen.prototype, { +setup() { + super.setup(); + this.dialog = useService("dialog"); + }, + async addProductToOrder(...args) { + var type = this.pos.config.stock_type + if (this.pos.config.is_restrict_product && ((type == 'qty_on_hand') && (args['0'].qty_available <= 0)) | ((type == 'virtual_qty') && (args['0'].virtual_available <= 0)) | + ((args['0'].qty_available <= 0) && (args['0'].virtual_available <= 0))) { + // If the product restriction is activated in the settings and quantity is out stock, it show the restrict popup. + this.dialog.add(ConfirmationDialog, { + body: _t("%s is out of stock. Do you want to proceed?", args['0'].display_name), + confirmLabel: _t("Order"), + confirm: () => { + const product = args['0']; + product.order_status = true; + super.addProductToOrder(...args) + }, + cancel: () => {}, + }); + } + else{ + await super.addProductToOrder(...args) + } + }, +}); diff --git a/pos_restrict_product_stock/static/src/xml/ProductItem.xml b/pos_restrict_product_stock/static/src/xml/ProductItem.xml new file mode 100644 index 000000000..0f7e8265d --- /dev/null +++ b/pos_restrict_product_stock/static/src/xml/ProductItem.xml @@ -0,0 +1,32 @@ + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+
+
+
+
+
diff --git a/pos_restrict_product_stock/views/res_config_settings_views.xml b/pos_restrict_product_stock/views/res_config_settings_views.xml new file mode 100644 index 000000000..2ae014df8 --- /dev/null +++ b/pos_restrict_product_stock/views/res_config_settings_views.xml @@ -0,0 +1,58 @@ + + + + + + res.config.settings.view.form.inherit.pos.restrict.product.stock + + res.config.settings + + + + +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+