diff --git a/product_batch_report/README.rst b/product_batch_report/README.rst new file mode 100644 index 000000000..21942dd09 --- /dev/null +++ b/product_batch_report/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-OPL--1-red.svg + :target: https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps + :alt: License: OPL-1 + +Lot and Serial Number Expiry Report +=================================== +Generates a report based on lot and serial number expiry dates or product expiry date. + +Configuration +============= +The user should be added to the security group: Administrator(Inventory/ Stock) inorder to get access to the new menu. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Open Public License , Version 1 (OPL-1). +(https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps) + +Credits +------- +Developer : (V17) Bhagyadev KP +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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/product_batch_report/__init__.py b/product_batch_report/__init__.py new file mode 100644 index 000000000..34b168a4f --- /dev/null +++ b/product_batch_report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is under the terms of Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import wizard diff --git a/product_batch_report/__manifest__.py b/product_batch_report/__manifest__.py new file mode 100644 index 000000000..b3db2a27b --- /dev/null +++ b/product_batch_report/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is under the terms of Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +################################################################################ +{ + 'name': 'Lot and Serial Number Expiry Report', + 'version': '17.0.1.0.0', + 'category': 'Warehouse', + 'summary': """Generates a detailed Lot and Serial Number Expiry based on + their expiry details.""", + 'description': """This module helps you to print a report about tracking + products (lot/serial) based on their expiry date. You can filter your + report based on different criteria.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['stock'], + 'data': [ + 'security/ir.model.access.csv', + 'report/product_batch_report_reports.xml', + 'report/product_batch_report_templates.xml', + 'wizard/product_batch_report_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'OPL-1', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/product_batch_report/doc/RELEASE_NOTES.md b/product_batch_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..42aed3e77 --- /dev/null +++ b/product_batch_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 05.03.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit for Lot and Serial Number Expiry Report diff --git a/product_batch_report/report/product_batch_report_reports.xml b/product_batch_report/report/product_batch_report_reports.xml new file mode 100644 index 000000000..3f8d4909f --- /dev/null +++ b/product_batch_report/report/product_batch_report_reports.xml @@ -0,0 +1,12 @@ + + + + + Lot/Serial Number Expiry PDF Report + product.batch.report + qweb-pdf + product_batch_report.product_batch_report_template + product_batch_report.product_batch_report_template + True + + diff --git a/product_batch_report/report/product_batch_report_templates.xml b/product_batch_report/report/product_batch_report_templates.xml new file mode 100644 index 000000000..48b378af8 --- /dev/null +++ b/product_batch_report/report/product_batch_report_templates.xml @@ -0,0 +1,92 @@ + + + + + diff --git a/product_batch_report/security/ir.model.access.csv b/product_batch_report/security/ir.model.access.csv new file mode 100644 index 000000000..bd3016aad --- /dev/null +++ b/product_batch_report/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_product_batch_report_user,product.batch.report.user,model_product_batch_report,stock.group_stock_user,1,0,0,0 +access_product_batch_report_manager,product.batch.report.manager,model_product_batch_report,stock.group_stock_manager,1,1,1,1 diff --git a/product_batch_report/static/description/assets/icons/capture (1).png b/product_batch_report/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/product_batch_report/static/description/assets/icons/capture (1).png differ diff --git a/product_batch_report/static/description/assets/icons/check.png b/product_batch_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/product_batch_report/static/description/assets/icons/check.png differ diff --git a/product_batch_report/static/description/assets/icons/chevron.png b/product_batch_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/chevron.png differ diff --git a/product_batch_report/static/description/assets/icons/cogs.png b/product_batch_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/cogs.png differ diff --git a/product_batch_report/static/description/assets/icons/consultation.png b/product_batch_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_batch_report/static/description/assets/icons/consultation.png differ diff --git a/product_batch_report/static/description/assets/icons/ecom-black.png b/product_batch_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/ecom-black.png differ diff --git a/product_batch_report/static/description/assets/icons/education-black.png b/product_batch_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_batch_report/static/description/assets/icons/education-black.png differ diff --git a/product_batch_report/static/description/assets/icons/hotel-black.png b/product_batch_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_batch_report/static/description/assets/icons/hotel-black.png differ diff --git a/product_batch_report/static/description/assets/icons/img.png b/product_batch_report/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/img.png differ diff --git a/product_batch_report/static/description/assets/icons/license.png b/product_batch_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_batch_report/static/description/assets/icons/license.png differ diff --git a/product_batch_report/static/description/assets/icons/lifebuoy.png b/product_batch_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_batch_report/static/description/assets/icons/lifebuoy.png differ diff --git a/product_batch_report/static/description/assets/icons/manufacturing-black.png b/product_batch_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_batch_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_batch_report/static/description/assets/icons/photo-capture.png b/product_batch_report/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/photo-capture.png differ diff --git a/product_batch_report/static/description/assets/icons/pos-black.png b/product_batch_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/pos-black.png differ diff --git a/product_batch_report/static/description/assets/icons/puzzle.png b/product_batch_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/puzzle.png differ diff --git a/product_batch_report/static/description/assets/icons/restaurant-black.png b/product_batch_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/restaurant-black.png differ diff --git a/product_batch_report/static/description/assets/icons/service-black.png b/product_batch_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_batch_report/static/description/assets/icons/service-black.png differ diff --git a/product_batch_report/static/description/assets/icons/trading-black.png b/product_batch_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_batch_report/static/description/assets/icons/trading-black.png differ diff --git a/product_batch_report/static/description/assets/icons/training.png b/product_batch_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_batch_report/static/description/assets/icons/training.png differ diff --git a/product_batch_report/static/description/assets/icons/update.png b/product_batch_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_batch_report/static/description/assets/icons/update.png differ diff --git a/product_batch_report/static/description/assets/icons/user.png b/product_batch_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_batch_report/static/description/assets/icons/user.png differ diff --git a/product_batch_report/static/description/assets/icons/wrench.png b/product_batch_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_batch_report/static/description/assets/icons/wrench.png differ diff --git a/product_batch_report/static/description/assets/misc/Cybrosys R.png b/product_batch_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/product_batch_report/static/description/assets/misc/Cybrosys R.png differ diff --git a/product_batch_report/static/description/assets/misc/email.svg b/product_batch_report/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_batch_report/static/description/assets/misc/phone.svg b/product_batch_report/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_batch_report/static/description/assets/misc/star (1) 2.svg b/product_batch_report/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/product_batch_report/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_batch_report/static/description/assets/misc/support (1) 1.svg b/product_batch_report/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_batch_report/static/description/assets/misc/support-email.svg b/product_batch_report/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/product_batch_report/static/description/assets/misc/tick-mark.svg b/product_batch_report/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/product_batch_report/static/description/assets/misc/whatsapp 1.svg b/product_batch_report/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/product_batch_report/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_batch_report/static/description/assets/misc/whatsapp.svg b/product_batch_report/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/product_batch_report/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_batch_report/static/description/assets/modules/inventory_barcode_scanning.png b/product_batch_report/static/description/assets/modules/inventory_barcode_scanning.png new file mode 100644 index 000000000..33d248669 Binary files /dev/null and b/product_batch_report/static/description/assets/modules/inventory_barcode_scanning.png differ diff --git a/product_batch_report/static/description/assets/modules/inventory_report_generator.png b/product_batch_report/static/description/assets/modules/inventory_report_generator.png new file mode 100644 index 000000000..6125017d4 Binary files /dev/null and b/product_batch_report/static/description/assets/modules/inventory_report_generator.png differ diff --git a/product_batch_report/static/description/assets/modules/odoo_product_tags.png b/product_batch_report/static/description/assets/modules/odoo_product_tags.png new file mode 100644 index 000000000..b73a9af74 Binary files /dev/null and b/product_batch_report/static/description/assets/modules/odoo_product_tags.png differ diff --git a/product_batch_report/static/description/assets/modules/product_barcode.png b/product_batch_report/static/description/assets/modules/product_barcode.png new file mode 100644 index 000000000..40fba50af Binary files /dev/null and b/product_batch_report/static/description/assets/modules/product_barcode.png differ diff --git a/product_batch_report/static/description/assets/modules/product_batch_report.png b/product_batch_report/static/description/assets/modules/product_batch_report.png new file mode 100644 index 000000000..55fa8c462 Binary files /dev/null and b/product_batch_report/static/description/assets/modules/product_batch_report.png differ diff --git a/product_batch_report/static/description/assets/modules/quality_assurance.png b/product_batch_report/static/description/assets/modules/quality_assurance.png new file mode 100644 index 000000000..489d1fe06 Binary files /dev/null and b/product_batch_report/static/description/assets/modules/quality_assurance.png differ diff --git a/product_batch_report/static/description/assets/screenshots/1.png b/product_batch_report/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6e178ccb1 Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/1.png differ diff --git a/product_batch_report/static/description/assets/screenshots/2.png b/product_batch_report/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..19b5eda7f Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/2.png differ diff --git a/product_batch_report/static/description/assets/screenshots/3.png b/product_batch_report/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..c9ec185a2 Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/3.png differ diff --git a/product_batch_report/static/description/assets/screenshots/4.png b/product_batch_report/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6b21f66f3 Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/4.png differ diff --git a/product_batch_report/static/description/assets/screenshots/5.png b/product_batch_report/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..134014809 Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/5.png differ diff --git a/product_batch_report/static/description/assets/screenshots/6.png b/product_batch_report/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..ae1c7015e Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/6.png differ diff --git a/product_batch_report/static/description/assets/screenshots/hero.gif b/product_batch_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1a0f24919 Binary files /dev/null and b/product_batch_report/static/description/assets/screenshots/hero.gif differ diff --git a/product_batch_report/static/description/banner.jpg b/product_batch_report/static/description/banner.jpg new file mode 100644 index 000000000..6be74bc94 Binary files /dev/null and b/product_batch_report/static/description/banner.jpg differ diff --git a/product_batch_report/static/description/icon.png b/product_batch_report/static/description/icon.png new file mode 100644 index 000000000..8c72de5ea Binary files /dev/null and b/product_batch_report/static/description/icon.png differ diff --git a/product_batch_report/static/description/index.html b/product_batch_report/static/description/index.html new file mode 100644 index 000000000..61341bead --- /dev/null +++ b/product_batch_report/static/description/index.html @@ -0,0 +1,622 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

Lot and Serial Number Expiry Report

+

+ Print a report on tracking products (lot/serial) based on their expiry date. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Generate PDF Reports.

+

Generates lot/serial number expiry report in PDF format. +

+
+
+
+
+
+
+ +
+
+

Print Report Based on Lot/Serial Number or Product.

+

Generates print report based on lot/serial number or based on products. +

+
+
+
+
+
+
+ +
+
+

Filter Reports

+

Filtering of report based on expired or expiring traceable products. +

+
+
+
+
+
+
+ +
+
+

Enter Days Rather than Date

+

Options to enter days rather than date. +

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

+ Access from the reporting menu - Inventory --> Reporting --> Lot/Serial Expiry

+
+
+
+
+
+
+ +
+
+

Expiry report tracking by lots/serial number.

+
+
+
+
+
+
+ +
+
+

Expiry report tracking by products. +

+
+
+
+
+
+
+ +
+
+

Select the set of products to be tracked. +

+
+
+
+
+
+
+ +
+
+

Enter the number of days before or within which the expiry takes place. +

+
+
+
+
+
+
+ +
+
+

A detailed PDF report based on input values.

+
+
+
+
+
+
+
    +
  • + Generates lot/serial number expiry report in PDF format. +
  • +
  • + Generates print report based on lot/serial number or based on products. +
  • +
  • + Filtering of report based on expired or expiring traceable products. +
  • +
  • + Options to enter days rather than date. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:5th March 2024 +
+

+ + Initial Commit for Lot and Serial Number Expiry Report.

+
+
+
+
+
+
+
+

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/product_batch_report/wizard/__init__.py b/product_batch_report/wizard/__init__.py new file mode 100644 index 000000000..8458c932c --- /dev/null +++ b/product_batch_report/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is under the terms of Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import product_batch_report diff --git a/product_batch_report/wizard/product_batch_report.py b/product_batch_report/wizard/product_batch_report.py new file mode 100644 index 000000000..4782363e1 --- /dev/null +++ b/product_batch_report/wizard/product_batch_report.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is under the terms of Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +################################################################################ +from datetime import datetime, timedelta +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class ProductBatchReport(models.TransientModel): + """Model to create product batch report""" + _name = 'product.batch.report' + _description = 'Product Batch Report' + + tracking_wise = fields.Selection([ + ('tracking_wise', 'Lot/Serial Wise'), + ('product_wise', 'Product Wise'), ], + string='Tracking', default="tracking_wise", required=True, + help="Tracking wise") + product_ids = fields.Many2many('product.product', string='Product', + help="Add products") + expiry_days = fields.Integer(string='Within', help="Expire within...") + expiry_type = fields.Selection([ + ('expired', 'Expired'), + ('expire', 'Going to Expire'), ], + string='Tracking Type', required=True, help="Type of expire") + + def generate_pdf_report(self): + """ + This Function generates the values required to print the + PDF report. This function takes below arguments and + return a data dictionary to the report template. + + :param self: object pointer. + :return data_dict: Returns filtered data of stock lot and serial data to + the report template. + """ + expiration_config = self.env['res.config.settings'].search([], + order='id desc', + limit=1).mapped( + 'module_product_expiry') + if expiration_config: + if not expiration_config[0]: + raise UserError( + _('Please enable Expiration Settings to get the Report.')) + else: + raise UserError( + _('Please enable Expiration Settings to get the Report.')) + if self.expiry_days: + if self.expiry_days < 0: + raise UserError(_('Please Enter a Non Negative Number.')) + today = datetime.strftime(datetime.today(), '%Y-%m-%d %H:%M:%S') + batch_data = self.env['stock.lot'] + if self.product_ids: + for product in self.product_ids: + batch_data += batch_data.search( + [('product_id', '=', product.id), + ('product_id.qty_available', '>', 0)]) + else: + batch_data = batch_data.search( + [('product_id.qty_available', '>', 0)]) + if self.expiry_type == 'expired': + batch_data = batch_data.filtered( + lambda l: str(l.expiration_date) <= today) + else: + batch_data = batch_data.filtered( + lambda l: str(l.expiration_date) >= today) + values = [] + heading = [] + date_within = '' + if self.expiry_days: + if self.expiry_type == 'expired': + date_within = datetime.strftime( + (datetime.today() - timedelta(days=int(self.expiry_days))), + '%Y-%m-%d %H:%M:%S') + batch_data = batch_data.filtered( + lambda l: str(date_within) <= str(l.expiration_date) <= str( + today)) + else: + date_within = datetime.strftime( + (datetime.today() + timedelta(days=int(self.expiry_days))), + '%Y-%m-%d %H:%M:%S') + batch_data = batch_data.filtered( + lambda l: str(date_within) >= str(l.expiration_date) >= str( + today)) + batch_data = batch_data.filtered(lambda l: l.expiration_date) + for line in batch_data: + values.append({ + 'lot_name': line.name, + 'product': line.product_id.name, + 'expiry_date': line.expiration_date, + 'expiry_days': str( + (datetime.strptime(str(line.expiration_date), + "%Y-%m-%d %H:%M:%S") - datetime.strptime( + today, "%Y-%m-%d %H:%M:%S")).days).replace("-", + "") + " Days" + }) + if self.tracking_wise == 'tracking_wise': + heading.append({ + 'name': line.id + }) + else: + heading.append({ + 'name': line.product_id.name + }) + heading = [i for n, i in enumerate(heading) if + i not in heading[n + 1:]] + view_type = self.tracking_wise + data_dict = { + 'values': values, + 'heading': heading, + 'view_type': view_type, + 'expiry_type': self.expiry_type, + 'today': today.split(' ')[0], + 'date_within': str(date_within).split(' ')[0], + 'expiry_days': self.expiry_days, + } + return (self.env.ref( + 'product_batch_report.product_batch_report_action_report'). + report_action(self, data=data_dict)) diff --git a/product_batch_report/wizard/product_batch_report_views.xml b/product_batch_report/wizard/product_batch_report_views.xml new file mode 100644 index 000000000..209cbe7bc --- /dev/null +++ b/product_batch_report/wizard/product_batch_report_views.xml @@ -0,0 +1,41 @@ + + + + + product.batch.report.view.form + product.batch.report + +
+ + + + + + + + + +
+
+
+
+
+ + + Lot or Serial Expiring Report + product.batch.report + ir.actions.act_window + form + new + + + +