diff --git a/pos_traceability_validation/README.rst b/pos_traceability_validation/README.rst new file mode 100644 index 000000000..c849805fc --- /dev/null +++ b/pos_traceability_validation/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +POS Serial Number Validator +=========================== +Validate Serial number of a product by checking availability in stock + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Jumana Jabin MP , + (V17) Busthana Shirin, + 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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/pos_traceability_validation/__init__.py b/pos_traceability_validation/__init__.py new file mode 100644 index 000000000..968ee7813 --- /dev/null +++ b/pos_traceability_validation/__init__.py @@ -0,0 +1,21 @@ +# -*- 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 LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/pos_traceability_validation/__manifest__.py b/pos_traceability_validation/__manifest__.py new file mode 100644 index 000000000..f9a857110 --- /dev/null +++ b/pos_traceability_validation/__manifest__.py @@ -0,0 +1,49 @@ +# -*- 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 LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'POS Serial Number Validator', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Validate Serial number of a product by checking + availability in stock""", + 'description': """This module validates the serial number of a product in + the Point of Sale (POS) by checking its availability + in stock. If the serial number is not in stock or + is a duplicate entry, it displays an error message.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['point_of_sale', 'stock', 'web'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_traceability_validation/static/src/xml/pos_orderline.xml', + 'pos_traceability_validation/static/src/js/CustomPopup.js', + 'pos_traceability_validation/static/src/js/pos_traceability_validation.js', + 'pos_traceability_validation/static/src/js/pos_orderline.js', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/pos_traceability_validation/doc/RELEASE_NOTES.md b/pos_traceability_validation/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..1d642cc57 --- /dev/null +++ b/pos_traceability_validation/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 03.08.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for POS Serial Number Validator diff --git a/pos_traceability_validation/models/__init__.py b/pos_traceability_validation/models/__init__.py new file mode 100644 index 000000000..acc259d3e --- /dev/null +++ b/pos_traceability_validation/models/__init__.py @@ -0,0 +1,21 @@ +# -*- 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 LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import stock_lot diff --git a/pos_traceability_validation/models/stock_lot.py b/pos_traceability_validation/models/stock_lot.py new file mode 100644 index 000000000..3425b4809 --- /dev/null +++ b/pos_traceability_validation/models/stock_lot.py @@ -0,0 +1,48 @@ +# -*- 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 LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import api, models + + +class StockLot(models.Model): + """Serial Number Validation Model.This model is used for serial number + validation in Odoo.""" + _inherit = 'stock.lot' + + @api.model + def validate_lots(self, lots): + """ This method validates a list of lots.""" + processed = [] + LotObj = self.env['stock.lot'] + for lot in lots: + lot_id = LotObj.search([('name', '=', lot)], limit=1) + if lot in processed: + return ['duplicate', lot] + if lot_id.product_qty <= 0: + return ['no_stock', lot] + processed.append(lot) + return True + + @api.model + def get_available_lots_qty_pos(self, product_id, lot_name): + """Check the max lot quantity of corresponding product.""" + stock_quant = self.env['stock.lot'].search([ + ('product_id', '=', product_id), ('name', '=', lot_name)]) + return stock_quant.product_qty diff --git a/pos_traceability_validation/static/description/assets/icons/capture (1).png b/pos_traceability_validation/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/capture (1).png differ diff --git a/pos_traceability_validation/static/description/assets/icons/check.png b/pos_traceability_validation/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/check.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/chevron.png b/pos_traceability_validation/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/chevron.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/cogs.png b/pos_traceability_validation/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/cogs.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/consultation.png b/pos_traceability_validation/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/consultation.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/ecom-black.png b/pos_traceability_validation/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/ecom-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/education-black.png b/pos_traceability_validation/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/education-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/hotel-black.png b/pos_traceability_validation/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/hotel-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/img.png b/pos_traceability_validation/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/img.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/license.png b/pos_traceability_validation/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/license.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/lifebuoy.png b/pos_traceability_validation/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/manufacturing-black.png b/pos_traceability_validation/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/photo-capture.png b/pos_traceability_validation/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/photo-capture.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/pos-black.png b/pos_traceability_validation/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/pos-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/puzzle.png b/pos_traceability_validation/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/puzzle.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/restaurant-black.png b/pos_traceability_validation/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/service-black.png b/pos_traceability_validation/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/service-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/trading-black.png b/pos_traceability_validation/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/trading-black.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/training.png b/pos_traceability_validation/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/training.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/update.png b/pos_traceability_validation/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/update.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/user.png b/pos_traceability_validation/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/user.png differ diff --git a/pos_traceability_validation/static/description/assets/icons/wrench.png b/pos_traceability_validation/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_traceability_validation/static/description/assets/icons/wrench.png differ diff --git a/pos_traceability_validation/static/description/assets/misc/Cybrosys R.png b/pos_traceability_validation/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_traceability_validation/static/description/assets/misc/email.svg b/pos_traceability_validation/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/phone.svg b/pos_traceability_validation/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_traceability_validation/static/description/assets/misc/star (1) 2.svg b/pos_traceability_validation/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/support (1) 1.svg b/pos_traceability_validation/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/support-email.svg b/pos_traceability_validation/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/tick-mark.svg b/pos_traceability_validation/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/whatsapp 1.svg b/pos_traceability_validation/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/misc/whatsapp.svg b/pos_traceability_validation/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/pos_traceability_validation/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_traceability_validation/static/description/assets/modules/banner1.jpg b/pos_traceability_validation/static/description/assets/modules/banner1.jpg new file mode 100644 index 000000000..d704eb313 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner1.jpg differ diff --git a/pos_traceability_validation/static/description/assets/modules/banner2.jpg b/pos_traceability_validation/static/description/assets/modules/banner2.jpg new file mode 100644 index 000000000..535b8aa14 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner2.jpg differ diff --git a/pos_traceability_validation/static/description/assets/modules/banner3.jpg b/pos_traceability_validation/static/description/assets/modules/banner3.jpg new file mode 100644 index 000000000..18035aa10 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner3.jpg differ diff --git a/pos_traceability_validation/static/description/assets/modules/banner4.jpg b/pos_traceability_validation/static/description/assets/modules/banner4.jpg new file mode 100644 index 000000000..a68431b9d Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner4.jpg differ diff --git a/pos_traceability_validation/static/description/assets/modules/banner5.jpg b/pos_traceability_validation/static/description/assets/modules/banner5.jpg new file mode 100644 index 000000000..5d47bad17 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner5.jpg differ diff --git a/pos_traceability_validation/static/description/assets/modules/banner6.jpg b/pos_traceability_validation/static/description/assets/modules/banner6.jpg new file mode 100644 index 000000000..614902f75 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/modules/banner6.jpg differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/hero.gif b/pos_traceability_validation/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..e365f4ece Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/hero.gif differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr1.png b/pos_traceability_validation/static/description/assets/screenshots/tr1.png new file mode 100644 index 000000000..e13c4ff13 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr1.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr2.png b/pos_traceability_validation/static/description/assets/screenshots/tr2.png new file mode 100644 index 000000000..354da79f7 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr2.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr3.png b/pos_traceability_validation/static/description/assets/screenshots/tr3.png new file mode 100644 index 000000000..e2ea7f8f5 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr3.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr4.png b/pos_traceability_validation/static/description/assets/screenshots/tr4.png new file mode 100644 index 000000000..0179c0605 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr4.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr5.png b/pos_traceability_validation/static/description/assets/screenshots/tr5.png new file mode 100644 index 000000000..adb379ae8 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr5.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr6.png b/pos_traceability_validation/static/description/assets/screenshots/tr6.png new file mode 100644 index 000000000..57668dbfc Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr6.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr7.png b/pos_traceability_validation/static/description/assets/screenshots/tr7.png new file mode 100644 index 000000000..341ddcdbc Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr7.png differ diff --git a/pos_traceability_validation/static/description/assets/screenshots/tr8.png b/pos_traceability_validation/static/description/assets/screenshots/tr8.png new file mode 100644 index 000000000..fc258d635 Binary files /dev/null and b/pos_traceability_validation/static/description/assets/screenshots/tr8.png differ diff --git a/pos_traceability_validation/static/description/banner.png b/pos_traceability_validation/static/description/banner.png new file mode 100644 index 000000000..e3c2f7181 Binary files /dev/null and b/pos_traceability_validation/static/description/banner.png differ diff --git a/pos_traceability_validation/static/description/icon.png b/pos_traceability_validation/static/description/icon.png new file mode 100644 index 000000000..324e1e032 Binary files /dev/null and b/pos_traceability_validation/static/description/icon.png differ diff --git a/pos_traceability_validation/static/description/index.html b/pos_traceability_validation/static/description/index.html new file mode 100644 index 000000000..96bb2e2c8 --- /dev/null +++ b/pos_traceability_validation/static/description/index.html @@ -0,0 +1,783 @@ + + + + + + + Timesheet PDF Report + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.Sh +
+
+
+
+
+
+

+ POS Serial Number Validator

+

+ Validate Serial Number of a Product by Checking + Availability in Stock. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Validates The Serial Number Of Product.

+

+ This module validates the serial number of a + product in the Point of Sale (POS) by checking + its availability in stock. +

+
+
+
+
+
+
+ +
+
+

+ Community and Enterprise.

+

The Time + Available in Odoo 17.0 Community and Enterprise. +

+
+
+
+
+
+
+ +
+
+

+ Validates given Serial Number is Available in + Stock

+

If the + serial number is not in stock, it displays an + error message.. +

+
+
+
+
+
+
+ +
+
+

+ Prevents Duplicated Entry for more than one + Quantity

+

If the + serial number is a duplicate + entry, it displays an error message. +

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

+ Enable Lot & Serial Number for a Product and + Assign Values +

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

+ Add a Product with a Serial Number or Lot + Number to the POS Product Screen. +

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

+ Warnings for invalid Serial Number

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

+ Warnings for Duplicate Serial Number +

+
+
+
+
+
+
+ +
+
+
+
+
+
+
    +
  • + Validates The Serial Number Of Product. +
  • +
  • + Prevents Duplicated Entry for more than one Quantity +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:05th Jul 2024 +
+

+ + Initial Commit for POS Serial Number Validator.

+
+
+
+
+
+
+
+

+ 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 +
+
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/pos_traceability_validation/static/src/js/CustomPopup.js b/pos_traceability_validation/static/src/js/CustomPopup.js new file mode 100644 index 000000000..ef79f6fee --- /dev/null +++ b/pos_traceability_validation/static/src/js/CustomPopup.js @@ -0,0 +1,17 @@ +/** @odoo-module */ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useRef, onMounted } from "@odoo/owl"; +/** +* This class represents a custom popup in the Point of Sale. +* It extends the AbstractAwaitablePopup class. +*/ +export class CustomButtonPopup extends AbstractAwaitablePopup { + static template = "pos_traceability_validation.CustomButtonPopup"; + static defaultProps = { + closePopup: _t("Cancel"), + body: _t("Product quantity Exceeding the allowed lot quantity"), + title: _t("Exception"), + }; +} \ No newline at end of file diff --git a/pos_traceability_validation/static/src/js/pos_orderline.js b/pos_traceability_validation/static/src/js/pos_orderline.js new file mode 100644 index 000000000..bf65c57d3 --- /dev/null +++ b/pos_traceability_validation/static/src/js/pos_orderline.js @@ -0,0 +1,32 @@ +/** @odoo-module */ +import { Orderline } from "@point_of_sale/app/store/models" +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 { usePos } from "@point_of_sale/app/store/pos_hook"; +import { _t } from "@web/core/l10n/translation"; +import { browser } from "@web/core/browser/browser"; +import { CustomButtonPopup } from "./CustomPopup"; + +patch(Orderline.prototype, { + + async set_quantity(quantity, keep_price) { +// Checking the orderline quantity and onhand lot quantity + super.set_quantity(quantity, keep_price); + var lines = await this.get_lot_lines() + if(lines.length){ + var product_id = this.get_product().id + var lot_name = lines[0].lot_name + const result = await this.pos.orm.call( + "stock.lot", "get_available_lots_qty_pos", [product_id, lot_name], {} + ) + if (quantity > result) { + this.quantity = result + await this.env.services.popup.add(CustomButtonPopup, { + title: _t("Exception"), + }); + browser.location.reload() + } + } + } +}); diff --git a/pos_traceability_validation/static/src/js/pos_traceability_validation.js b/pos_traceability_validation/static/src/js/pos_traceability_validation.js new file mode 100644 index 000000000..5ec347869 --- /dev/null +++ b/pos_traceability_validation/static/src/js/pos_traceability_validation.js @@ -0,0 +1,71 @@ +/** @odoo-module */ +import { EditListPopup } from "@point_of_sale/app/store/select_lot_popup/select_lot_popup" +import { Orderline } from "@point_of_sale/app/store/models" +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 { usePos } from "@point_of_sale/app/store/pos_hook"; +import { _t } from "@web/core/l10n/translation"; + + +patch(EditListPopup.prototype, { + setup() { + /**Updating the orm and popup**/ + this.pos = usePos(); + this.orm = useService("orm"); + this.popup = useService("popup"); + super.setup(...arguments); + }, + async confirm() { + /**Checking the lot and serial and raising the error popup**/ + if (this.props.title === 'Lot/Serial Number(s) Required'){ + var lot_string = this.state.array + var lot_names = []; + for (var i = 0; i < lot_string.length; i++) { + if (lot_string[i].text != ""){ + lot_names.push(lot_string[i].text); + } + } + const result = await this.orm.call( + "stock.lot", "validate_lots", [lot_names], {} + ) + if(result != true){ + if(result[0] == 'no_stock'){ + this.env.services.popup.add(ErrorPopup, { + title: _t("Insufficient stock"), + body: _t( + "Insufficient stock for " + result[1] + ), + }); + } + else if(result[0] == 'duplicate'){ + this.env.services.popup.add(ErrorPopup, { + title: _t("Duplicate entry"), + body: _t( + "Duplicate entry for " + result[1] + ), + }); + } + else if(result[0] == 'except'){ + alert("Exception occurred with " + result[1]) + this.env.services.popup.add(ErrorPopup, { + title: _t("Exception"), + body: _t( + "Exception occurred with" + result[1] + ), + }); + } + } + else{ + this.props.resolve({ confirmed: true, payload: await this.getPayload() }); + this.pos.closeTempScreen(); + this.props.close(); + } + } + else{ + this.props.resolve({ confirmed: true, payload: await this.getPayload() }); + this.pos.closeTempScreen(); + this.props.close(); + } + } +}); diff --git a/pos_traceability_validation/static/src/xml/pos_orderline.xml b/pos_traceability_validation/static/src/xml/pos_orderline.xml new file mode 100644 index 000000000..4a83028cb --- /dev/null +++ b/pos_traceability_validation/static/src/xml/pos_orderline.xml @@ -0,0 +1,24 @@ + + + + + + +