diff --git a/pos_product_stock/README.rst b/pos_product_stock/README.rst new file mode 100644 index 000000000..e7c4c905d --- /dev/null +++ b/pos_product_stock/README.rst @@ -0,0 +1,46 @@ +.. 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 + +POS Product Stock +================= +This module helps you to show Product quantity based on location in POS and also deny order if the quantity reaches its limit. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +======= +General Public License, version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer : (V17) 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/pos_product_stock/__init__.py b/pos_product_stock/__init__.py new file mode 100644 index 000000000..d96aecdec --- /dev/null +++ b/pos_product_stock/__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 models diff --git a/pos_product_stock/__manifest__.py b/pos_product_stock/__manifest__.py new file mode 100644 index 000000000..42a3c1e29 --- /dev/null +++ b/pos_product_stock/__manifest__.py @@ -0,0 +1,52 @@ +# -*- 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': 'POS Product Stock', + 'version': "17.0.1.0.0", + 'category': 'Point Of Sale', + 'summary': "Quantity of all Products in each Warehouse", + 'description': "Shows Stock quantity in POS for all Products in each Warehouse, Odoo 17", + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base','point_of_sale','stock'], + 'data': [ + 'views/res_cofig_settings_views.xml', + 'views/product_template_views.xml', + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_product_stock/static/src/xml/product_item.xml', + 'pos_product_stock/static/src/css/product_quantity.scss', + 'pos_product_stock/static/src/js/pos_location.js', + 'pos_product_stock/static/src/js/pos_payment_screen.js', + 'pos_product_stock/static/src/js/pos_session.js', + 'pos_product_stock/static/src/js/deny_order.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_product_stock/doc/RELEASE_NOTES.md b/pos_product_stock/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f4d64bf65 --- /dev/null +++ b/pos_product_stock/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 28.11.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for POS Product Stock + diff --git a/pos_product_stock/models/__init__.py b/pos_product_stock/models/__init__.py new file mode 100644 index 000000000..a1164b02d --- /dev/null +++ b/pos_product_stock/models/__init__.py @@ -0,0 +1,25 @@ +# -*- 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 res_config_settings +from . import pos_session +from . import pos_config +from . import product_template diff --git a/pos_product_stock/models/pos_config.py b/pos_product_stock/models/pos_config.py new file mode 100644 index 000000000..b18574f2e --- /dev/null +++ b/pos_product_stock/models/pos_config.py @@ -0,0 +1,42 @@ +# -*- 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, models + + +class PosConfig(models.Model): + """inherit pos.config to add fields.""" + _inherit = 'pos.config' + + pos_stock_location_id = fields.Many2one('stock.location', string='Stock Location', + help="This field helps to hold the location") + location_from = fields.Selection([('all_warehouse', 'All Location'), + ('current_warehouse', 'Current Location')], + string="Show Stock Of", + help="can choose the location where you want to display the stock ") + display_stock_setting = fields.Boolean(string="Display Stock", + help="By enabling you can view quantity in Point Of Sale", + default=False) + stock_product = fields.Selection([('on_hand', 'On Hand Quantity'), + ('incoming_qty', 'Incoming Quantity'), + ('outgoing_qty', 'Outgoing Quantity')], + string="Stock Type", + help="Help you to choose the quantity you want to visible in pos") diff --git a/pos_product_stock/models/pos_session.py b/pos_product_stock/models/pos_session.py new file mode 100644 index 000000000..6570a804e --- /dev/null +++ b/pos_product_stock/models/pos_session.py @@ -0,0 +1,105 @@ +# -*- 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 + + +class PosSession(models.Model): + """inherit pos. session to add fields and modules in session.""" + _inherit = 'pos.session' + + @api.model + def _pos_ui_models_to_load(self): + """ we use super function inorder to extend the _pos_ui_models + _to_load function and added res.config.settings , + stock.quant,stock.move.line""" + result = super()._pos_ui_models_to_load() + result += [ + 'res.config.settings', + 'stock.quant', + 'stock.move.line', + ] + return result + + def _loader_params_product_product(self): + """to load product. product in session""" + result = super()._loader_params_product_product() + result['search_params']['fields'].append('qty_available') + result['search_params']['fields'].append('incoming_qty') + result['search_params']['fields'].append('outgoing_qty') + result['search_params']['fields'].append('free_qty') + result['search_params']['fields'].append('deny') + result['search_params']['fields'].append('detailed_type') + return result + + def _loader_params_stock_quant(self): + """Load some fields with a certain domain of stock.quant in session.""" + location_id = self.config_id.pos_stock_location_id + if location_id: + domain = ['|', ('location_id', '=', location_id.id), ('location_id', 'in', location_id.child_ids.ids)] + else: + domain = [] + return { + 'search_params': { + 'domain': domain, + 'fields': ['product_id', 'available_quantity', 'quantity', 'location_id'], + }, + } + + def _loader_params_stock_move_line(self): + """load some fields of stock.move.line in session""" + return { + 'search_params': { + 'fields': ['product_id', 'location_dest_id', 'quantity', 'location_id'], + }, + } + + def _loader_params_res_config_settings(self): + """load some fields of base settings in session""" + return { + 'search_params': { + 'fields': ['display_stock', 'stock_type', + 'stock_from', 'stock_location_id'], + } + } + + def _get_pos_ui_res_config_settings(self, params): + """this function should use the search_read + method to search and read records from the base setting""" + config_settings = self.env['res.config.settings'].sudo().search_read(**params['search_params']) + if config_settings: + last_config_setting = config_settings[-1] + return last_config_setting + else: + last_config_setting = False + return last_config_setting + + def _get_pos_ui_stock_quant(self, params): + """this function should use the search_read method + to search and read records from the stock.quant""" + return self.env['stock.quant']. \ + search_read(**params['search_params']) + + def _get_pos_ui_stock_move_line(self, params): + """this function should use the search_read'method to + search and read records from the stock.move.line'""" + return self.env['stock.move.line'] \ + .search_read(**params['search_params']) diff --git a/pos_product_stock/models/product_template.py b/pos_product_stock/models/product_template.py new file mode 100644 index 000000000..2f9eb2b38 --- /dev/null +++ b/pos_product_stock/models/product_template.py @@ -0,0 +1,30 @@ +# -*- 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, models, api + + +class ProductTemplate(models.Model): + """inherit product.template to add field.""" + _inherit = "product.template" + + deny = fields.Integer(string="Deny POS Order", default=0, + help="Set a limit so that you can deny POS Order") diff --git a/pos_product_stock/models/res_config_settings.py b/pos_product_stock/models/res_config_settings.py new file mode 100644 index 000000000..de1b4b746 --- /dev/null +++ b/pos_product_stock/models/res_config_settings.py @@ -0,0 +1,43 @@ +# -*- 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, models + + +class ResConfigSettings(models.TransientModel): + """ Inherit the base settings to add field. """ + _inherit = 'res.config.settings' + + display_stock = fields.Boolean(string="Display Stock", + readonly=False, help="By enabling you can " + "view quantity in Point Of Sale", + default=False, config_parameter='pos_product_stock.display_stock') + stock_type = fields.Selection(related='pos_config_id.stock_product', + string="Stock Type", readonly=False, + required=True, help="Help you to choose " + "the quantity you want to visible in pos") + stock_from = fields.Selection(related='pos_config_id.location_from', + string="Show Stock Of", readonly=False, + required=True, help="can choose the location " + "where you want to display the stock ") + stock_location_id = fields.Many2one(related='pos_config_id.pos_stock_location_id', + string="Stock Location", readonly=False, + help="This field helps to hold the location") diff --git a/pos_product_stock/static/description/Icon.png b/pos_product_stock/static/description/Icon.png new file mode 100644 index 000000000..661787340 Binary files /dev/null and b/pos_product_stock/static/description/Icon.png differ diff --git a/pos_product_stock/static/description/assets/icons/check.png b/pos_product_stock/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/check.png differ diff --git a/pos_product_stock/static/description/assets/icons/chevron.png b/pos_product_stock/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/chevron.png differ diff --git a/pos_product_stock/static/description/assets/icons/cogs.png b/pos_product_stock/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/cogs.png differ diff --git a/pos_product_stock/static/description/assets/icons/consultation.png b/pos_product_stock/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/consultation.png differ diff --git a/pos_product_stock/static/description/assets/icons/ecom-black.png b/pos_product_stock/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/ecom-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/education-black.png b/pos_product_stock/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/education-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/hotel-black.png b/pos_product_stock/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/hotel-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/license.png b/pos_product_stock/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/license.png differ diff --git a/pos_product_stock/static/description/assets/icons/lifebuoy.png b/pos_product_stock/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_product_stock/static/description/assets/icons/logo.png b/pos_product_stock/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/logo.png differ diff --git a/pos_product_stock/static/description/assets/icons/manufacturing-black.png b/pos_product_stock/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/pos-black.png b/pos_product_stock/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/pos-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/puzzle.png b/pos_product_stock/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/puzzle.png differ diff --git a/pos_product_stock/static/description/assets/icons/restaurant-black.png b/pos_product_stock/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/service-black.png b/pos_product_stock/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/service-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/trading-black.png b/pos_product_stock/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/trading-black.png differ diff --git a/pos_product_stock/static/description/assets/icons/training.png b/pos_product_stock/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/training.png differ diff --git a/pos_product_stock/static/description/assets/icons/update.png b/pos_product_stock/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/update.png differ diff --git a/pos_product_stock/static/description/assets/icons/user.png b/pos_product_stock/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/user.png differ diff --git a/pos_product_stock/static/description/assets/icons/wrench.png b/pos_product_stock/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_product_stock/static/description/assets/icons/wrench.png differ diff --git a/pos_product_stock/static/description/assets/misc/Cybrosys R.png b/pos_product_stock/static/description/assets/misc/Cybrosys R.png new file mode 100755 index 000000000..da4058087 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_product_stock/static/description/assets/misc/categories.png b/pos_product_stock/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/categories.png differ diff --git a/pos_product_stock/static/description/assets/misc/check-box.png b/pos_product_stock/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/check-box.png differ diff --git a/pos_product_stock/static/description/assets/misc/compass.png b/pos_product_stock/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/compass.png differ diff --git a/pos_product_stock/static/description/assets/misc/corporate.png b/pos_product_stock/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/corporate.png differ diff --git a/pos_product_stock/static/description/assets/misc/customer-support.png b/pos_product_stock/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/customer-support.png differ diff --git a/pos_product_stock/static/description/assets/misc/cybrosys-logo.png b/pos_product_stock/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_product_stock/static/description/assets/misc/email.svg b/pos_product_stock/static/description/assets/misc/email.svg new file mode 100755 index 000000000..15291cdc3 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/features.png b/pos_product_stock/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/features.png differ diff --git a/pos_product_stock/static/description/assets/misc/logo.png b/pos_product_stock/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/logo.png differ diff --git a/pos_product_stock/static/description/assets/misc/phone.svg b/pos_product_stock/static/description/assets/misc/phone.svg new file mode 100755 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_product_stock/static/description/assets/misc/pictures.png b/pos_product_stock/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/pictures.png differ diff --git a/pos_product_stock/static/description/assets/misc/pie-chart.png b/pos_product_stock/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/pie-chart.png differ diff --git a/pos_product_stock/static/description/assets/misc/right-arrow.png b/pos_product_stock/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/right-arrow.png differ diff --git a/pos_product_stock/static/description/assets/misc/star (1) 2.svg b/pos_product_stock/static/description/assets/misc/star (1) 2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/star.png b/pos_product_stock/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/star.png differ diff --git a/pos_product_stock/static/description/assets/misc/support (1) 1.svg b/pos_product_stock/static/description/assets/misc/support (1) 1.svg new file mode 100755 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/support-email.svg b/pos_product_stock/static/description/assets/misc/support-email.svg new file mode 100755 index 000000000..eb70370d6 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/support.png b/pos_product_stock/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/support.png differ diff --git a/pos_product_stock/static/description/assets/misc/tick-mark.svg b/pos_product_stock/static/description/assets/misc/tick-mark.svg new file mode 100755 index 000000000..2dbb40187 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/whatsapp 1.svg b/pos_product_stock/static/description/assets/misc/whatsapp 1.svg new file mode 100755 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/misc/whatsapp.png b/pos_product_stock/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/pos_product_stock/static/description/assets/misc/whatsapp.png differ diff --git a/pos_product_stock/static/description/assets/misc/whatsapp.svg b/pos_product_stock/static/description/assets/misc/whatsapp.svg new file mode 100755 index 000000000..b618aea1d --- /dev/null +++ b/pos_product_stock/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_product_stock/static/description/assets/modules/1.png b/pos_product_stock/static/description/assets/modules/1.png new file mode 100644 index 000000000..45411318a Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/1.png differ diff --git a/pos_product_stock/static/description/assets/modules/2.png b/pos_product_stock/static/description/assets/modules/2.png new file mode 100644 index 000000000..535b8aa14 Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/2.png differ diff --git a/pos_product_stock/static/description/assets/modules/3.png b/pos_product_stock/static/description/assets/modules/3.png new file mode 100644 index 000000000..18035aa10 Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/3.png differ diff --git a/pos_product_stock/static/description/assets/modules/4.png b/pos_product_stock/static/description/assets/modules/4.png new file mode 100644 index 000000000..d704eb313 Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/4.png differ diff --git a/pos_product_stock/static/description/assets/modules/5.png b/pos_product_stock/static/description/assets/modules/5.png new file mode 100644 index 000000000..a68431b9d Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/5.png differ diff --git a/pos_product_stock/static/description/assets/modules/6.png b/pos_product_stock/static/description/assets/modules/6.png new file mode 100644 index 000000000..a5299d338 Binary files /dev/null and b/pos_product_stock/static/description/assets/modules/6.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/hero.gif b/pos_product_stock/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..01abdcf97 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/hero.gif differ diff --git a/pos_product_stock/static/description/assets/screenshots/screenshot1.png b/pos_product_stock/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..c364d53b3 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/screenshot1.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/screenshot2.png b/pos_product_stock/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..27722405d Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/screenshot2.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/screenshot3.png b/pos_product_stock/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..ae631d46c Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/screenshot3.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/screenshot4.png b/pos_product_stock/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..b577096be Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/screenshot4.png differ diff --git a/pos_product_stock/static/description/banner.jpg b/pos_product_stock/static/description/banner.jpg new file mode 100644 index 000000000..3d61ca6a7 Binary files /dev/null and b/pos_product_stock/static/description/banner.jpg differ diff --git a/pos_product_stock/static/description/index.html b/pos_product_stock/static/description/index.html new file mode 100644 index 000000000..2f7bb6cd8 --- /dev/null +++ b/pos_product_stock/static/description/index.html @@ -0,0 +1,744 @@ + + + + + + + POS Product Stock + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ POS Product Stock +

+

+ Shows Quantity of all Product in POS. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Community & Enterprise Support.

+
+
+
+
+
+
+ +
+
+

+ POS Product Stock.

+
+
+
+
+
+
+ +
+
+

+ Shows quantity of product in POS.

+
+
+
+
+
+
+ +
+
+

+ Deny Order in POS by setting quantity in each product.

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

+ Display Stock in POS. +

+

+ Go to Point Of Sale -> Configuration -> Settings -> + Display Stock. By enabling this feature you need to choose stock type as well as Location.

+
+
+
+
+
+
+ +
+
+

+ Show Quantity +

+

Go to Point Of Sale -> Dashboard -> Shop -> NEW SESSION. + According to criteria you have chosen in settings Quantity will be displayed in pos session

+
+
+
+
+
+
+ +
+
+

+ Deny Order +

+

+ Go to Point Of Sale ->Products ->Products -> Sales page -> Deny POS Order. + User can set a limit so that order can be denied. +

+
+
+
+
+
+
+ +
+
+

+ Error Pop Up +

+

+ Go to Point Of Sale ->Dashboard -> Shop -> NEW SESSION. + if the value in quantity is less than or equal to Deny POS Order then the order will be denied + and shows Error popup +

+
+
+
+
+
+
+
    +
  • + Shows quantity of product in POS. +
  • +
  • + + Display product stock based on location. +
  • +
  • + + Deny Order in POS by setting quantity in each product. +
  • +
  • + + Can display On Hand quantity,Incoming quantity and Outgoing quantity. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:28th November 2024 +
+

+ Initial Commit for POS Product Stock.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/pos_product_stock/static/src/css/product_quantity.scss b/pos_product_stock/static/src/css/product_quantity.scss new file mode 100644 index 000000000..03d2a5e51 --- /dev/null +++ b/pos_product_stock/static/src/css/product_quantity.scss @@ -0,0 +1,12 @@ +.dummy{ +background-color : #F0F8FF ; +} +.ribbon { + padding: 9px; + position: relative; + top: 0; + background-color: #c3d8c3; + font-weight: bold; + width: 26%; + height: 39px; +} diff --git a/pos_product_stock/static/src/js/deny_order.js b/pos_product_stock/static/src/js/deny_order.js new file mode 100644 index 000000000..73096b2ff --- /dev/null +++ b/pos_product_stock/static/src/js/deny_order.js @@ -0,0 +1,74 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; +import { _t } from "@web/core/l10n/translation"; + +patch(PosStore.prototype, { + async addProductToCurrentOrder(event) { + if (event.detailed_type === 'product') { + if (this.res_setting['stock_from'] === 'all_warehouse') { + if (this.res_setting['stock_type'] === 'on_hand') { + if (event.qty_available <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } else if (this.res_setting['stock_type'] === 'outgoing_qty') { + if (event.outgoing_qty <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } else if (this.res_setting['stock_type'] === 'incoming_qty') { + if (event.incoming_qty <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } + } else if (this.res_setting['stock_from'] === 'current_warehouse') { + if (this.res_setting['stock_type'] === 'on_hand') { + if (event.qty_available <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } else if (this.res_setting['stock_type'] === 'outgoing_qty') { + if (event.outgoing_qty <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } else if (this.res_setting['stock_type'] === 'incoming_qty') { + if (event.incoming_qty <= event.deny) { + await this.popup.add(ErrorPopup, { + title: _t('Deny Order'), + body: _t('%s is Out Of Stock', event.display_name), + }); + } else { + super.addProductToCurrentOrder(event); + } + } + } + } else { + super.addProductToCurrentOrder(event); + } + }, +}); \ No newline at end of file diff --git a/pos_product_stock/static/src/js/pos_location.js b/pos_product_stock/static/src/js/pos_location.js new file mode 100644 index 000000000..d395006fb --- /dev/null +++ b/pos_product_stock/static/src/js/pos_location.js @@ -0,0 +1,81 @@ +//** @odoo-module */ +import { ProductCard } from "@point_of_sale/app/generic_components/product_card/product_card"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; +import { useRef, useState } from "@odoo/owl"; + +patch(ProductCard.prototype, { + setup() { + super.setup(); + this.state = useState({ + qty_available: null, + incoming_qty: null, + outgoing_qty: null, + }); + this.pos = usePos(); + this.orm = useService('orm'); + }, + async fetchProductDetails(productId) { + const product = await this.orm.call("product.product", "read", [[productId], ["name", "id", "incoming_qty","outgoing_qty","qty_available"]]); + return product[0]; + }, + async updateProductDetails() { + const productId = this.props.productId; + if (productId) { + this.productDetail = await this.fetchProductDetails(productId); + } + }, + get value() { + if (this.pos.res_setting.display_stock == true) { + const current_product = this.props.productId; + const stock_product = this.pos.stock_quant; + const move_line = this.pos.move_line; + let qty = 0; + let on_hand = 0; + let outgoing = 0; + let incoming = 0; + + stock_product.forEach((product) => { + if (product.product_id[0] === current_product) { + qty += product.available_quantity; + on_hand += product.quantity; + } + }); + move_line.forEach((line) => { + if (line.product_id[0] == current_product && this.pos.res_setting && this.pos.res_setting.stock_location_id && this.pos.res_setting.stock_location_id[1] == line.location_dest_id[1]) { + incoming = incoming + line.quantity; + } else if (line.product_id[0] == current_product && this.pos.res_setting && this.pos.res_setting.stock_location_id && this.pos.res_setting.stock_location_id[1] == line.location_id[1]) { + outgoing = outgoing + line.quantity; + } + }); + if (!this.props.available) { + this.props.available = qty // pass value in session + } + if (!this.props.on_hand) { + this.props.on_hand = on_hand; + } + if (!this.props.outgoing) { + this.props.outgoing = outgoing + } + if (!this.props.incoming) { + this.props.incoming_loc = incoming + } + + this.updateProductDetails().then(() => { + this.state.qty_available = this.productDetail.qty_available + this.state.incoming_qty = this.productDetail.incoming_qty + this.state.outgoing_qty = this.productDetail.outgoing_qty + }); + return { + display_stock: this.pos.res_setting.display_stock + + }; + + } else { + return { + display_stock: false + }; + } + } +}); \ No newline at end of file diff --git a/pos_product_stock/static/src/js/pos_payment_screen.js b/pos_product_stock/static/src/js/pos_payment_screen.js new file mode 100644 index 000000000..e32a3a8c8 --- /dev/null +++ b/pos_product_stock/static/src/js/pos_payment_screen.js @@ -0,0 +1,52 @@ +/** @odoo-module **/ +import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import { patch } from "@web/core/utils/patch"; + +patch(PaymentScreen.prototype, { + setup() { + super.setup(...arguments); + }, + async validateOrder(isForceValidate) { + var order = this.pos.get_order(); + var lines = order.get_orderlines(); + + if (this.pos.res_setting['stock_from'] === 'all_warehouse') { + if (this.pos.res_setting['stock_type'] === 'on_hand') { + lines.forEach((line) => { + var order_quantity = line.quantity; + var new_qty = line.product.qty_available - order_quantity; + line.product.qty_available = new_qty; + }); + } else if (this.pos.res_setting['stock_type'] === 'outgoing_qty') { + lines.forEach((line) => { + var order_quantity = line.quantity; + }); + } else if (this.pos.res_setting['stock_type'] === 'incoming_qty') { + lines.forEach((line) => { + var order_quantity = line.quantity; + }); + } + } else if (this.pos.res_setting['stock_from'] === 'current_warehouse') { + if (this.pos.res_setting['stock_type'] === 'on_hand') { + lines.forEach((line) => { + var item_quantity = line.quantity; + var on_hand_qty = line.product.qty_available; + var new_qty = on_hand_qty - item_quantity; + line.product.qty_available = new_qty; + }); + } else if (this.pos.res_setting['stock_type'] === 'outgoing_qty') { + lines.forEach((line) => { + var item_quantity = line.quantity; + var out_going = line.product.outgoing; + }); + } else if (this.pos.res_setting['stock_type'] === 'incoming_qty') { + lines.forEach((line) => { + var item_quantity = line.quantity; + var incoming = line.product.incoming; + }); + } + } + + return super.validateOrder(...arguments); + } +}); \ No newline at end of file diff --git a/pos_product_stock/static/src/js/pos_session.js b/pos_product_stock/static/src/js/pos_session.js new file mode 100644 index 000000000..e3510eb8f --- /dev/null +++ b/pos_product_stock/static/src/js/pos_session.js @@ -0,0 +1,12 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; + +patch(PosStore.prototype, { + async _processData(loadedData) { + super._processData(...arguments); //used to call the original _processData + this.res_setting = loadedData['res.config.settings']; + this.stock_quant = loadedData['stock.quant']; + this.move_line = loadedData['stock.move.line']; + } + }) \ No newline at end of file diff --git a/pos_product_stock/static/src/xml/product_item.xml b/pos_product_stock/static/src/xml/product_item.xml new file mode 100644 index 000000000..0a67c1901 --- /dev/null +++ b/pos_product_stock/static/src/xml/product_item.xml @@ -0,0 +1,43 @@ + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/pos_product_stock/views/product_template_views.xml b/pos_product_stock/views/product_template_views.xml new file mode 100644 index 000000000..ea5166f23 --- /dev/null +++ b/pos_product_stock/views/product_template_views.xml @@ -0,0 +1,14 @@ + + + + + Product.template.view.form.inherit.pos.product.stock + product.template + + + + + + + + diff --git a/pos_product_stock/views/res_cofig_settings_views.xml b/pos_product_stock/views/res_cofig_settings_views.xml new file mode 100644 index 000000000..4c8ab8cdb --- /dev/null +++ b/pos_product_stock/views/res_cofig_settings_views.xml @@ -0,0 +1,41 @@ + + + + + res.config.settings.view.form.inherit.pos.product.stock + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+