diff --git a/product_expiry_warning/README.md b/product_expiry_warning/README.md new file mode 100755 index 000000000..8c916857b --- /dev/null +++ b/product_expiry_warning/README.md @@ -0,0 +1,39 @@ +Expiry Date Warning +=================== + +Generates warning for expired products, while selling the product. + + +Installation +============ +- www.odoo.com/documentation/14.0/setup/install.html +- Install our custom addons + +License +======= + +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (AGPL-3) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: 10.0 Avinash Nk (odoo@cybrosys.com) + 12.0 Kavya Raveendran(odoo@cybrosys.com) + 13.0 Vaishnavi B(odoo@cybrosys.com) + 14.0 Minhaj T(odoo@cybrosys.com) + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/product_expiry_warning/__init__.py b/product_expiry_warning/__init__.py new file mode 100644 index 000000000..e54325c59 --- /dev/null +++ b/product_expiry_warning/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Avinash Nk(odoo@cybrosys.com) +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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/product_expiry_warning/__manifest__.py b/product_expiry_warning/__manifest__.py new file mode 100644 index 000000000..d51ec134a --- /dev/null +++ b/product_expiry_warning/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Avinash Nk (odoo@cybrosys.com) +# you can modify it under the terms of the GNU LESSER +# 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 LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Expiry Date Warning', + 'summary': """Generates Warning for Expired Products, When it sells.""", + 'version': '14.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + "category": "Sales", + "depends": ["sale", 'sale_management', "stock", "product", "product_expiry"], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, +} diff --git a/product_expiry_warning/doc/RELEASE_NOTES.md b/product_expiry_warning/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..80079222f --- /dev/null +++ b/product_expiry_warning/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 13.10.2020 +#### Version 14.0.1.0.0 +#### ADD + +Initial Commit diff --git a/product_expiry_warning/models/__init__.py b/product_expiry_warning/models/__init__.py new file mode 100644 index 000000000..70c57d0dc --- /dev/null +++ b/product_expiry_warning/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Avinash Nk(odoo@cybrosys.com) +# +# 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 expiry_date_warning diff --git a/product_expiry_warning/models/expiry_date_warning.py b/product_expiry_warning/models/expiry_date_warning.py new file mode 100644 index 000000000..f047f14c9 --- /dev/null +++ b/product_expiry_warning/models/expiry_date_warning.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# 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 datetime import datetime, date +from odoo import api, fields, models, _ +from odoo.exceptions import UserError, ValidationError + + +class ExpiryDateWarning(models.Model): + _inherit = 'sale.order.line' + + @api.onchange('product_id', 'product_uom_qty') + def product_uom_change(self): + print("uom") + if self.product_id: + total_quantity = 0.0 + product_sale = self.product_id + quantity_in_lot = self.env['stock.quant'].search([]) + lot_number_obj = self.env['stock.production.lot'] + lot_number_obj_specific = lot_number_obj.search([]) + for records in lot_number_obj_specific: + dates = date.today() + print(dates,"dates") + print(dates, "dates") + if records.expiration_date: + dates = datetime.strptime(str(records.expiration_date), '%Y-%m-%d %H:%M:%S') + print(dates, "datessssssssssss") + if records.product_id.id == product_sale.id: + if records.expiration_date and records.expiration_date.date() < date.today(): + for values in quantity_in_lot: + if values.lot_id.id == records.id and values.product_id.id == product_sale.id: + if values.quantity >= 0: + total_quantity = total_quantity + values.quantity + # elif records.product_id.id == product_sale.id and dates.date() is False: + # raise ValidationError(_("Set lot number and expiration date.")) + good_products = self.product_id.qty_available - total_quantity + if good_products < self.product_uom_qty: + warning_mess = { + 'title': _('Not enough good products!'), + 'message': _( + 'You plan to sell %.2f %s but you only have %.2f %s good products available!\n' + 'The stock on hand is %.2f %s.') % ( + self.product_uom_qty, self.product_uom.name, good_products, + self.product_id.uom_id.name, + self.product_id.qty_available, self.product_id.uom_id.name) + } + return {'warning': warning_mess} + + +class ExpiryDateStockPackOperation(models.Model): + _inherit = 'stock.picking' + + @api.onchange('move_line_ids_without_package') + def move_line_ids_change(self): + print("move_line_ids_change") + lots = self.move_line_ids.lot_id + lot_list = [] + for lot in lots: + if self.product_id == lot.product_id: + if lot.expiration_date: + today = date.today() + expiration_date = datetime.strptime(str(lot.expiration_date), '%Y-%m-%d %H:%M:%S') + if expiration_date.date() < today: + lot_list.append(str(lot.name)) + if len(lot_list) == 1: + raise UserError(_('Product in this lot number is expired : %s' % lot_list[0])) + elif len(lot_list) > 1: + raise UserError(_('Products in these lot numbers are expired : %s' % lot_list)) diff --git a/product_expiry_warning/static/description/banner.png b/product_expiry_warning/static/description/banner.png new file mode 100644 index 000000000..40a648727 Binary files /dev/null and b/product_expiry_warning/static/description/banner.png differ diff --git a/product_expiry_warning/static/description/icon.png b/product_expiry_warning/static/description/icon.png new file mode 100644 index 000000000..3fe6bbc2a Binary files /dev/null and b/product_expiry_warning/static/description/icon.png differ diff --git a/product_expiry_warning/static/description/images/banner_lifeline_for_task.jpeg b/product_expiry_warning/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/product_expiry_warning/static/description/images/banner_project_report_xls_pdf.png b/product_expiry_warning/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/product_expiry_warning/static/description/images/banner_project_status_report.png b/product_expiry_warning/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_project_status_report.png differ diff --git a/product_expiry_warning/static/description/images/banner_subtask.jpeg b/product_expiry_warning/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_subtask.jpeg differ diff --git a/product_expiry_warning/static/description/images/banner_task_deadline_reminder.jpeg b/product_expiry_warning/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/product_expiry_warning/static/description/images/banner_task_statusbar.jpeg b/product_expiry_warning/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/product_expiry_warning/static/description/images/banner_task_statusbar.jpeg differ diff --git a/product_expiry_warning/static/description/images/checked.png b/product_expiry_warning/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/product_expiry_warning/static/description/images/checked.png differ diff --git a/product_expiry_warning/static/description/images/cybrosys.png b/product_expiry_warning/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/product_expiry_warning/static/description/images/cybrosys.png differ diff --git a/product_expiry_warning/static/description/images/lot_exp date.png b/product_expiry_warning/static/description/images/lot_exp date.png new file mode 100644 index 000000000..acea93841 Binary files /dev/null and b/product_expiry_warning/static/description/images/lot_exp date.png differ diff --git a/product_expiry_warning/static/description/images/so warning.png b/product_expiry_warning/static/description/images/so warning.png new file mode 100644 index 000000000..fbca52f4f Binary files /dev/null and b/product_expiry_warning/static/description/images/so warning.png differ diff --git a/product_expiry_warning/static/description/images/stock pick warn.png b/product_expiry_warning/static/description/images/stock pick warn.png new file mode 100644 index 000000000..75b3d4ea7 Binary files /dev/null and b/product_expiry_warning/static/description/images/stock pick warn.png differ diff --git a/product_expiry_warning/static/description/images/warning.png b/product_expiry_warning/static/description/images/warning.png new file mode 100644 index 000000000..919dfec47 Binary files /dev/null and b/product_expiry_warning/static/description/images/warning.png differ diff --git a/product_expiry_warning/static/description/index.html b/product_expiry_warning/static/description/index.html new file mode 100644 index 000000000..a84bdef98 --- /dev/null +++ b/product_expiry_warning/static/description/index.html @@ -0,0 +1,309 @@ +
cybrosys-logo
+
+
+
+

Expiry Date Warning

+

Generates warning for expired products, when we sell the product.

+
+

Key Highlights

+
    + +
  • Both Sales and Inventory Section Gets the Warning Message
  • +
  • Integrate with Products Expiration Date Module
  • + +
+
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ In Odoo ERP you can set expiry date for any product. But what if we failed to notice an expired product and attempt to sell the same? Expiry Date Warning App by team Cybrosys solve the issue by generating a warning message while you try to sell an expired product. This app uses the "End of life date" you set for a product to generate the warning. So first, you need to set an Expiry date for a product.

+

Read this blog from Cybrosys to know "How to set expiry date for a product". + Blog : https://www.cybrosys.com/blog/how-setup-product-expiry-dates-in-odoo

+
+
+ +

Make MRP orders from POS

+
+
    + +
  • + Both Sales and Inventory Section Gets the Warning Message +
  • + +
  • + Integrate with Products Expiration Date Module +
  • + +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+ +
+
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file