@ -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 |
||||
|
|
||||
|
Product Low Stock Alert |
||||
|
======================= |
||||
|
* Product low stock alert display in Point of Sale and Product Views. |
||||
|
|
||||
|
Configuration |
||||
|
============ |
||||
|
- Need to turn on the option 'Low Stock Alert' in the Inventory configuration |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Lesser General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer: |
||||
|
(v16) anfas, |
||||
|
(v17) Sadique Kottekkat |
||||
|
(V18) Rosmy John |
||||
|
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: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,54 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': "Product Low Stock Alert", |
||||
|
'version': '18.0.1.0.0', |
||||
|
"category": 'Warehouse,Point of Sale', |
||||
|
'summary': """Product Low Stock Alert Display in Point of Sale and |
||||
|
Product Views""", |
||||
|
'description': """Module adds functionality to display product stock |
||||
|
alerts in the point of sale interface, indicating low stock levels for |
||||
|
products and also in the product template kanban and list view.""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['product', 'point_of_sale'], |
||||
|
'data': [ |
||||
|
'views/res_config_settings_views.xml', |
||||
|
'views/product_product_views.xml', |
||||
|
'views/product_template_views.xml' |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_backend': [ |
||||
|
'low_stocks_product_alert/static/src/css/template_color.css', |
||||
|
], |
||||
|
'point_of_sale._assets_pos': [ |
||||
|
'low_stocks_product_alert/static/src/xml/product_item_template.xml', |
||||
|
], |
||||
|
}, |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': "LGPL-3", |
||||
|
'installable': True, |
||||
|
'application': False, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
## Module <low_stocks_product_alert> |
||||
|
|
||||
|
#### 07.12.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
|
||||
|
- Initial commit for Product Low Stock Alert |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import product_product |
||||
|
from . import product_template |
||||
|
from . import res_config_settings |
@ -0,0 +1,60 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class ProductProduct(models.Model): |
||||
|
""" |
||||
|
This is an Odoo model for product products. It inherits from the |
||||
|
'product.product' model and extends its functionality by adding a |
||||
|
computed field for product alert state. |
||||
|
|
||||
|
Methods: |
||||
|
_compute_alert_tag(): Computes the value of the 'alert_tag' field based on the |
||||
|
product's stock quantity and configured low stock alert parameters |
||||
|
""" |
||||
|
_inherit = 'product.product' |
||||
|
|
||||
|
alert_tag = fields.Char( |
||||
|
string='Product Alert Tag', compute='_compute_alert_tag', |
||||
|
help='This field represents the alert tag of the product.') |
||||
|
|
||||
|
@api.depends('qty_available') |
||||
|
def _compute_alert_tag(self): |
||||
|
"""Computes the value of the 'alert_tag' field based on the product's |
||||
|
stock quantity and configured low stock alert parameters.""" |
||||
|
stock_alert = self.env['ir.config_parameter'].sudo().get_param( |
||||
|
'low_stocks_product_alert.is_low_stock_alert') |
||||
|
for rec in self: |
||||
|
if stock_alert: |
||||
|
is_low_stock = True if rec.type == 'consu' and rec.qty_available <= int( |
||||
|
self.env['ir.config_parameter'].sudo().get_param( |
||||
|
'low_stocks_product_alert.min_low_stock_alert')) else False |
||||
|
rec.alert_tag = rec.qty_available if is_low_stock else False |
||||
|
else: |
||||
|
rec.alert_tag = False |
||||
|
|
||||
|
@api.model |
||||
|
def _load_pos_data_fields(self, config_id): |
||||
|
result = super()._load_pos_data_fields(config_id) |
||||
|
result.append('alert_tag') |
||||
|
return result |
@ -0,0 +1,62 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class ProductTemplate(models.Model): |
||||
|
""" |
||||
|
This is an Odoo model for product templates. It inherits from the |
||||
|
'product.template' model and extends its functionality by adding computed |
||||
|
fields for product alert state and color field. |
||||
|
|
||||
|
Methods: |
||||
|
_compute_alert_state: Computes the 'alert_state' and 'color_field' |
||||
|
fields based on the product's stock quantity and low stock |
||||
|
alert parameters |
||||
|
|
||||
|
""" |
||||
|
_inherit = 'product.template' |
||||
|
|
||||
|
alert_state = fields.Boolean(string='Product Alert State', |
||||
|
compute='_compute_alert_state', |
||||
|
help='This field represents the alert state' |
||||
|
'of the product') |
||||
|
color_field = fields.Char(string='Background color', |
||||
|
help='This field represents the background ' |
||||
|
'color of the product.') |
||||
|
|
||||
|
@api.depends('qty_available') |
||||
|
def _compute_alert_state(self): |
||||
|
""" Computes the 'alert_state' and 'color_field' fields based on |
||||
|
the product's stock quantity and low stock alert parameters.""" |
||||
|
stock_alert = self.env['ir.config_parameter'].sudo().get_param( |
||||
|
'low_stocks_product_alert.is_low_stock_alert') |
||||
|
for rec in self: |
||||
|
if stock_alert: |
||||
|
rec.alert_state, rec.color_field = (False, 'white') if \ |
||||
|
rec.type != 'consu' or rec.qty_available > int( |
||||
|
rec.env['ir.config_parameter'].sudo().get_param( |
||||
|
'low_stocks_product_alert.min_low_stock_alert')) \ |
||||
|
else (True, '#fdc6c673') |
||||
|
else: |
||||
|
rec.alert_state = False |
||||
|
rec.color_field = 'white' |
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# 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 |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
""" |
||||
|
This is an Odoo model for configuration settings. It inherits from the |
||||
|
'res.config.settings' model and extends its functionality by adding |
||||
|
fields for low stock alert configuration |
||||
|
""" |
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
is_low_stock_alert = fields.Boolean( |
||||
|
string="Low Stock Alert", |
||||
|
help='This field determines the minimum stock quantity at which a low ' |
||||
|
'stock alert will be triggered.When the product quantity falls ' |
||||
|
'below this value, the background color for the product will be ' |
||||
|
'changed based on the alert state.', |
||||
|
config_parameter='low_stocks_product_alert.is_low_stock_alert') |
||||
|
min_low_stock_alert = fields.Integer( |
||||
|
string='Alert Quantity', default=0, |
||||
|
help='Change the background color for the product based' |
||||
|
'on the Alert Quant.', |
||||
|
config_parameter='low_stocks_product_alert.min_low_stock_alert') |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 242 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 298 KiB |
After Width: | Height: | Size: 404 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 171 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 175 KiB |
After Width: | Height: | Size: 27 KiB |