diff --git a/pos_product_stock/README.rst b/pos_product_stock/README.rst new file mode 100644 index 000000000..079fd9439 --- /dev/null +++ b/pos_product_stock/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://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 `__ + +Credits +------- +* Developers: Cybrosys Techno Solutions odoo@cybrosys.com + Version 16: Rahna Rasheed @cybrosys + + +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..44cf08ee1 --- /dev/null +++ b/pos_product_stock/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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..7087851d3 --- /dev/null +++ b/pos_product_stock/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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': "16.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 16", + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'license': 'AGPL-3', + 'depends': [ + 'base', + 'point_of_sale', + 'stock', + ], + 'data': [ + 'views/res_cofig_settings_views.xml', + 'views/product_template_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + '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.png'], + '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..4817074a5 --- /dev/null +++ b/pos_product_stock/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 06.11.2023 +#### Version 16.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..cb52c8e3d --- /dev/null +++ b/pos_product_stock/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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..e9fc8139b --- /dev/null +++ b/pos_product_stock/models/pos_config.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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'), + ('available_qty', 'Available 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..0dfd9e281 --- /dev/null +++ b/pos_product_stock/models/pos_session.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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 certain domain of stock.quant in session""" + location_id = self.config_id.pos_stock_location_id + return { + 'search_params': { + 'domain': ['|', ('location_id', '=', location_id.id), + ('location_id', 'in', location_id.child_ids.ids)], + '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', 'qty_done', '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'].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..a963661d0 --- /dev/null +++ b/pos_product_stock/models/product_template.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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 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..632fad3cc --- /dev/null +++ b/pos_product_stock/models/res_config_settings.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Rahna Rasheed () +# +# 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/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/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/categories.png b/pos_product_stock/static/description/assets/misc/categories.png new file mode 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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/features.png b/pos_product_stock/static/description/assets/misc/features.png new file mode 100644 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 100644 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/pictures.png b/pos_product_stock/static/description/assets/misc/pictures.png new file mode 100644 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 100644 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 100644 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.png b/pos_product_stock/static/description/assets/misc/star.png new file mode 100644 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.png b/pos_product_stock/static/description/assets/misc/support.png new file mode 100644 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/whatsapp.png b/pos_product_stock/static/description/assets/misc/whatsapp.png new file mode 100644 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/modules/1.png b/pos_product_stock/static/description/assets/modules/1.png new file mode 100644 index 000000000..489f44e86 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..fd1f87699 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..5514bb8d4 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..b55ddc812 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..347c97957 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..ac5cbdc80 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/.~lock.AAAAAAAAAAAAAAA.xlsx# b/pos_product_stock/static/description/assets/screenshots/.~lock.AAAAAAAAAAAAAAA.xlsx# new file mode 100644 index 000000000..37791f27e --- /dev/null +++ b/pos_product_stock/static/description/assets/screenshots/.~lock.AAAAAAAAAAAAAAA.xlsx# @@ -0,0 +1 @@ +,cybrosys,cybrosys-ThinkPad-E14-Gen-3,14.06.2023 12:25,file:///home/cybrosys/.config/libreoffice/4; \ No newline at end of file diff --git a/pos_product_stock/static/description/assets/screenshots/AAAAAAAAAAAAAAA.xlsx b/pos_product_stock/static/description/assets/screenshots/AAAAAAAAAAAAAAA.xlsx new file mode 100644 index 000000000..c6aac9a98 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/AAAAAAAAAAAAAAA.xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/Stock Report-2022-11-13.xlsx b/pos_product_stock/static/description/assets/screenshots/Stock Report-2022-11-13.xlsx new file mode 100644 index 000000000..e36932c54 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/Stock Report-2022-11-13.xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (1).xlsx b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (1).xlsx new file mode 100644 index 000000000..c070a5543 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (1).xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (2).xlsx b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (2).xlsx new file mode 100644 index 000000000..91b28cf5d Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx (2).xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx.xlsx b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx.xlsx new file mode 100644 index 000000000..eeb2005a7 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi.production.report.xlsx.xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (1).xlsx b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (1).xlsx new file mode 100644 index 000000000..8865808f0 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (1).xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (2).xlsx b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (2).xlsx new file mode 100644 index 000000000..74dcc2147 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx (2).xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx.xlsx b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx.xlsx new file mode 100644 index 000000000..699ec8874 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi_cash_list.bi_cash_report_xslx.xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx (1).xlsx b/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx (1).xlsx new file mode 100644 index 000000000..46c860039 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx (1).xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx.xlsx b/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx.xlsx new file mode 100644 index 000000000..717acb003 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/bi_weight_category_report.weight_category_xlsx.xslx.xlsx differ diff --git a/pos_product_stock/static/description/assets/screenshots/download.jpeg b/pos_product_stock/static/description/assets/screenshots/download.jpeg new file mode 100644 index 000000000..4c8bb5b68 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/download.jpeg 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..f524317d8 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/pos_product_stock_01.png b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_01.png new file mode 100644 index 000000000..858525c9d Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_01.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/pos_product_stock_02.png b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_02.png new file mode 100644 index 000000000..dfd0f0ae0 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_02.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/pos_product_stock_03.png b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_03.png new file mode 100644 index 000000000..5bcad1a99 Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_03.png differ diff --git a/pos_product_stock/static/description/assets/screenshots/pos_product_stock_04.png b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_04.png new file mode 100644 index 000000000..e30069e4f Binary files /dev/null and b/pos_product_stock/static/description/assets/screenshots/pos_product_stock_04.png differ diff --git a/pos_product_stock/static/description/banner.png b/pos_product_stock/static/description/banner.png new file mode 100644 index 000000000..84ed5210d Binary files /dev/null and b/pos_product_stock/static/description/banner.png differ diff --git a/pos_product_stock/static/description/icon.png b/pos_product_stock/static/description/icon.png new file mode 100644 index 000000000..7862d7ead Binary files /dev/null and b/pos_product_stock/static/description/icon.png 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..cd77e6580 --- /dev/null +++ b/pos_product_stock/static/description/index.html @@ -0,0 +1,575 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ POS + Product + Stock

+

Shows Quantity of all + Product in POS.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module shows Incoming, Outgoing ,On Hand and Available Quantity in POS also Deny order based on Value set + by user. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + POS Product Stock +
+
+ + Shows quantity of product in POS +
+
+ + Can display On Hand quantity,Incoming quantity,Available quantity and Outgoing quantity +
+
+ + Display product stock based on location +
+
+ + Deny Order in POS by setting quantity in each product. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

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 Deny POS Order is less than or equal to quantity in POS then the order will be denied + and shows Error popup

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

Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file 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..586b88751 --- /dev/null +++ b/pos_product_stock/static/src/css/product_quantity.scss @@ -0,0 +1,12 @@ +.dummy{ +background-color : #F0F8FF ; +} +.ribbon { + padding:4px; + position:absolute; + top:0; + right:0; + background-color:#c3d8c3; + height:19px; + font-weight: bold; +} 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..6928136fb --- /dev/null +++ b/pos_product_stock/static/src/js/deny_order.js @@ -0,0 +1,100 @@ +odoo.define('pos_product_stock.Custom', function(require) { + 'use strict'; + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const order = (ProductScreen) => class extends ProductScreen { + //we extends ProductScreen to super _clickproduct function. + async _clickProduct(event) { + if (event.detail.detailed_type == 'product') { + if (this.env.pos.res_setting['stock_from'] == 'all_warehouse') { + if (this.env.pos.res_setting['stock_type'] == 'on_hand') { + if (event.detail.qty_available <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); //shows error pop up as condition satisfies. + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'outgoing_qty') { + if (event.detail.outgoing_qty <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'incoming_qty') { + if (event.detail.incoming_qty <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'available_qty') { + if (event.detail.available_product <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } + } else if (this.env.pos.res_setting['stock_from'] == 'current_warehouse') { + if (this.env.pos.res_setting['stock_type'] == 'on_hand') { + if (event.detail.on_hand <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'outgoing_qty') { + if (event.detail.outgoing <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'incoming_qty') { + if (event.detail.incoming <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } else if (this.env.pos.res_setting['stock_type'] == 'available_qty') { + if (event.detail.available <= event.detail.deny) { + const body = _.str.sprintf(this.env._t('%s is Out Of Stock'), event.detail.display_name); + await this.showPopup('ErrorPopup', { + title: this.env._t('Deny Order'), + body + }); + } else { + super._clickProduct(event); + } + } + } + } else { + super._clickProduct(event); + } + } + } + Registries.Component.extend(ProductScreen, order); +}); 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..6bfde10df --- /dev/null +++ b/pos_product_stock/static/src/js/pos_location.js @@ -0,0 +1,60 @@ +odoo.define('Pos_product_stock.update', function(require) { + 'use strict'; + const ProductItem = require('point_of_sale.ProductItem'); + const Registries = require('point_of_sale.Registries'); + const Update = (ProductItem) => class extends ProductItem { //extend ProductItem and super setup() function. + setup() { + super.setup(...arguments); + } + get value() { + if (this.env.pos.res_setting.display_stock == true) { + const current_product = this.props.product.id + const stock_product = this.env.pos.stock_quant + const move_line = this.env.pos.move_line + var qty = 0; + var on_hand = 0; + var outgoing = 0; + var incoming = 0; + var available = 0; + stock_product.forEach((product) => { + if (product.product_id[0] == current_product) { + qty = qty + product.available_quantity; + on_hand = on_hand + product.quantity; + available = this.props.product.qty_available - this.props.product.outgoing_qty + } + }); + move_line.forEach((line) => { + if (line.product_id[0] == current_product && this.env.pos.res_setting && this.env.pos.res_setting.stock_location_id && this.env.pos.res_setting.stock_location_id[1] == line.location_dest_id[1]) { + incoming = incoming + line.qty_done; + } else if (line.product_id[0] == current_product && this.env.pos.res_setting && this.env.pos.res_setting.stock_location_id && this.env.pos.res_setting.stock_location_id[1] == line.location_id[1]) { + outgoing = outgoing + line.qty_done; + } + }); + if (!this.props.product.available) { + this.props.product.available = qty // pass value in session + } + if (!this.props.product.on_hand) { + this.props.product.on_hand = on_hand; + } + if (!this.props.product.outgoing) { + this.props.product.outgoing = outgoing + } + if (!this.props.product.incoming) { + this.props.product.incoming_loc = incoming + } + if (!this.props.product.available_product) { + this.props.product.available_product = available + } + return { + display_stock: this.env.pos.res_setting.display_stock + } + } else { + return { + display_stock: false + } + } + } + }; + Registries.Component.extend(ProductItem, Update); + return ProductItem; +}); 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..203d075b6 --- /dev/null +++ b/pos_product_stock/static/src/js/pos_payment_screen.js @@ -0,0 +1,67 @@ +odoo.define('pos_product_stock.PaymentScreen', function(require) { + 'use strict'; + const PaymentScreen = require('point_of_sale.PaymentScreen'); + const Registries = require('point_of_sale.Registries'); + const session = require('web.session'); + const Product = PaymentScreen => + class extends PaymentScreen { + //Extend PaymentScreen to super validateOrder and compute Quantity at the time of validate function + async validateOrder(isForceValidate) { + var order = this.env.pos.get_order(); + var lines = order.get_orderlines(); + if (this.env.pos.res_setting['stock_from'] == 'all_warehouse') { + if (this.env.pos.res_setting['stock_type'] == 'on_hand') { + lines.forEach((quantity) => { + var order_quantity = quantity.quantity + var new_qty = quantity.product.qty_available - order_quantity + quantity.product.qty_available = new_qty + }) + } else if (this.env.pos.res_setting['stock_type'] == 'outgoing_qty') { + lines.forEach((quantity) => { + var order_quantity = quantity.quantity + }) + } else if (this.env.pos.res_setting['stock_type'] == 'incoming_qty') { + lines.forEach((quantity) => { + var order_quantity = quantity.quantity + }) + } else if (this.env.pos.res_setting['stock_type'] == 'available_qty') { + lines.forEach((quantity) => { + var order_quantity = quantity.quantity + var available_qty = quantity.product.available_product + var new_qty = available_qty - order_quantity + quantity.product.available_product = new_qty + }) + } + } else if (this.env.pos.res_setting['stock_from'] == 'current_warehouse') { + if (this.env.pos.res_setting['stock_type'] == 'on_hand') { + lines.forEach((line) => { + var item_quantity = line.quantity + var on_hand_qty = line.product.on_hand + var new_qty = on_hand_qty - item_quantity + line.product.on_hand = new_qty + }) + } else if (this.env.pos.res_setting['stock_type'] == 'outgoing_qty') { + lines.forEach((line) => { + var item_quantity = line.quantity + var out_going = line.product.outgoing + }) + } else if (this.env.pos.res_setting['stock_type'] == 'incoming_qty') { + lines.forEach((line) => { + var item_quantity = line.quantity + var incoming = line.product.incoming + }) + } else if (this.env.pos.res_setting['stock_type'] == 'available_qty') { + lines.forEach((line) => { + var item_quantity = line.quantity + var available_qty = line.product.available + var new_qty = available_qty - item_quantity + line.product.available = new_qty + }) + } + } + return super.validateOrder(...arguments); + } + } + Registries.Component.extend(PaymentScreen, Product); + return PaymentScreen; +}); 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..5976048c7 --- /dev/null +++ b/pos_product_stock/static/src/js/pos_session.js @@ -0,0 +1,14 @@ +/** @odoo-module */ +import {PosGlobalState} from 'point_of_sale.models'; +import Registries from 'point_of_sale.Registries'; +const NewPosGlobalState = (PosGlobalState) => + class NewPosGlobalState extends PosGlobalState { // Define a new class that extends the PosGlobalState model. + // Then, add a new method called '_processData'. + async _processData(loadedData) { + await 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']; + } + } +Registries.Model.extend(PosGlobalState, NewPosGlobalState); 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..f39d273a7 --- /dev/null +++ b/pos_product_stock/static/src/xml/product_item.xml @@ -0,0 +1,54 @@ + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/pos_product_stock/static/src/xml/product_item_qty.xml b/pos_product_stock/static/src/xml/product_item_qty.xml new file mode 100644 index 000000000..4e2dfddb9 --- /dev/null +++ b/pos_product_stock/static/src/xml/product_item_qty.xml @@ -0,0 +1,54 @@ + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
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..b73403cc2 --- /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..f2535d3a1 --- /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 + + + +
+
+ +
+
+
+
+
+
+
+