diff --git a/low_stocks_product_alert/models/product_product.py b/low_stocks_product_alert/models/product_product.py index d41bc4deb..c81db3348 100644 --- a/low_stocks_product_alert/models/product_product.py +++ b/low_stocks_product_alert/models/product_product.py @@ -36,7 +36,18 @@ class ProductProduct(models.Model): alert_tag = fields.Char( string='Product Alert Tag', compute='_compute_alert_tag', - help='This field represents the alert tag of the product.') + help='This field represents the alert tag of the product.', store=True) + 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.', + ) + min_low_stock_alert = fields.Integer( + string='Alert Quantity', + help='Change the background color for the product based' + 'on the Alert Quant.') @api.depends('qty_available') def _compute_alert_tag(self): @@ -49,3 +60,9 @@ class ProductProduct(models.Model): self.env['ir.config_parameter'].sudo().get_param( 'low_stocks_product_alert.min_low_stock_alert')) rec.alert_tag = rec.qty_available if is_low_stock else False + elif self.env['ir.config_parameter'].sudo().get_param( + 'low_stocks_product_alert.is_low_stock_alert_individual'): + for rec in self: + is_low_stock_single = rec.detailed_type == 'product' and rec.qty_available <= int( + rec.min_low_stock_alert) + rec.alert_tag = rec.qty_available if is_low_stock_single else False diff --git a/low_stocks_product_alert/models/product_template.py b/low_stocks_product_alert/models/product_template.py index ac3dd4dd3..911eeea69 100644 --- a/low_stocks_product_alert/models/product_template.py +++ b/low_stocks_product_alert/models/product_template.py @@ -56,6 +56,12 @@ class ProductTemplate(models.Model): self.env['ir.config_parameter'].sudo().get_param( 'low_stocks_product_alert.min_low_stock_alert')) \ else (True, '#fdc6c673') + elif self.env['ir.config_parameter'].sudo().get_param( + 'low_stocks_product_alert.is_low_stock_alert_individual') and self.filtered(lambda x: x.product_variant_id.is_low_stock_alert): + for rec in self: + rec.alert_state, rec.color_field = (False, 'white') if \ + rec.detailed_type != 'product' or rec.qty_available > int(rec.product_variant_id.min_low_stock_alert) \ + else (True, '#fdc6c673') else: self.alert_state = False self.color_field = 'white' diff --git a/low_stocks_product_alert/models/res_config_settings.py b/low_stocks_product_alert/models/res_config_settings.py index bf5d9d221..1664a1ee2 100644 --- a/low_stocks_product_alert/models/res_config_settings.py +++ b/low_stocks_product_alert/models/res_config_settings.py @@ -19,7 +19,7 @@ # If not, see . # ############################################################################# -from odoo import fields, models +from odoo import api, fields, models class ResConfig(models.TransientModel): @@ -32,14 +32,31 @@ class ResConfig(models.TransientModel): _inherit = 'res.config.settings' is_low_stock_alert = fields.Boolean( - string="Low Stock Alert", + string="Low Stock Alert For All Products", 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') + is_low_stock_alert_individual = fields.Boolean( + string="Low Stock Alert For Individual Product", + 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_individual', + default=False) 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') + + @api.onchange('is_low_stock_alert_individual') + def _onchange_is_low_stock_alert_individual(self): + """The function is used to change the stock alert in the product form""" + if self.env['ir.config_parameter'].sudo().get_param( + 'low_stocks_product_alert.is_low_stock_alert_individual'): + product_variants = self.env['product.product'].search([]) + for rec in product_variants: + rec.is_low_stock_alert = True diff --git a/low_stocks_product_alert/static/description/assets/screenshots/1.png b/low_stocks_product_alert/static/description/assets/screenshots/1.png deleted file mode 100644 index ee9234ae4..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/1.png and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/2.png b/low_stocks_product_alert/static/description/assets/screenshots/2.png deleted file mode 100644 index e48d44597..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/2.png and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/3.png b/low_stocks_product_alert/static/description/assets/screenshots/3.png deleted file mode 100644 index 7e807b2f1..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/3.png and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/4.png b/low_stocks_product_alert/static/description/assets/screenshots/4.png deleted file mode 100644 index 384107fa0..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/4.png and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/5.png b/low_stocks_product_alert/static/description/assets/screenshots/5.png deleted file mode 100644 index 60761464f..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/5.png and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/hero.gif b/low_stocks_product_alert/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..267c80ab8 Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/hero.gif differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/low-stock-product-alert-v16-gif.gif b/low_stocks_product_alert/static/description/assets/screenshots/low-stock-product-alert-v16-gif.gif deleted file mode 100644 index 70710c54b..000000000 Binary files a/low_stocks_product_alert/static/description/assets/screenshots/low-stock-product-alert-v16-gif.gif and /dev/null differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows1.png b/low_stocks_product_alert/static/description/assets/screenshots/lows1.png new file mode 100644 index 000000000..9555e9794 Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows1.png differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows2.png b/low_stocks_product_alert/static/description/assets/screenshots/lows2.png new file mode 100644 index 000000000..fa4931637 Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows2.png differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows3.png b/low_stocks_product_alert/static/description/assets/screenshots/lows3.png new file mode 100644 index 000000000..8b8e2edb9 Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows3.png differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows4.png b/low_stocks_product_alert/static/description/assets/screenshots/lows4.png new file mode 100644 index 000000000..5f414670e Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows4.png differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows5.png b/low_stocks_product_alert/static/description/assets/screenshots/lows5.png new file mode 100644 index 000000000..394698008 Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows5.png differ diff --git a/low_stocks_product_alert/static/description/assets/screenshots/lows6.png b/low_stocks_product_alert/static/description/assets/screenshots/lows6.png new file mode 100644 index 000000000..28e6e067e Binary files /dev/null and b/low_stocks_product_alert/static/description/assets/screenshots/lows6.png differ diff --git a/low_stocks_product_alert/static/description/index.html b/low_stocks_product_alert/static/description/index.html index 3577b6d07..d09f9bf1a 100644 --- a/low_stocks_product_alert/static/description/index.html +++ b/low_stocks_product_alert/static/description/index.html @@ -1,19 +1,20 @@
- + style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;"> +
+ class="mr-2"> Community
+ class="mr-2"> Enterprise
+ class="mr-2"> Odoo.sh
@@ -21,66 +22,72 @@ -

Product Low Stock Alert

-

Simplify your stock management by promptly recognizing low stock items through highlighted red color.

+

+ Product Low Stock Alert

+

+ Simplify your stock management by promptly recognizing low stock items + through highlighted red color.

- +
-
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Explore This +

+ Explore This Module

@@ -88,42 +95,60 @@ -
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Overview +

+ Overview

-
+
-The Product Low Stock Alert module helps you to handle product stock in effective way. The product get highlighted when stock for a particular product falls below the defined minimum quantity. + The Product Low Stock Alert module helps you to handle product stock in + effective way. The product get highlighted when stock for a particular + product falls below the defined minimum quantity.
-
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Features +

+ Features

-
+
-
- +
+ Stock Alert in List & Kanban View -

Product details get highlighted in red color when the product quantity goes below the alert quantity defined.

+

Product details get + highlighted in red color when the product quantity goes below + the alert quantity defined.

-
- +
+ Alert Tag in POS -

Display the quantity and alert tag when the products go below the alert quantity defined.

+

Display the quantity + and alert tag when the products go below the alert quantity + defined.

@@ -132,65 +157,70 @@ The Product Low Stock Alert module helps you to handle product stock in effectiv -
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Screenshots +

+ Screenshots

- Enable the "Low Stock Alert "button.

-

- Go to Settings --> Enable "Low Stock Alert" button and enter - Alert Quantity. -

- + style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.7rem !important;"> + Enable the "Low Stock Alert for All Products" +

+ Go to Settings --> Enable "Low Stock Alert for All Products" button + and enter the + Alert Quantity. +

+

- List View

-

- If the quantity of the product is less than the quantity of - the alert quantity defined in the settings, the list view of - the product will display a red background color. -

- -
+ style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.7rem !important;"> + List View +

+ If the quantity of the product is less than the quantity of + the alert quantity defined in the settings, the list view of + the product will display a red background color. +

+ +
-
+
-
-

- Kanban View

-

- If the quantity of the product is less than the quantity of - the alert quantity defined in the settings, the kanban view - of the product will display a red background color. -

- -
+
+

+ Kanban View

+

+ If the quantity of the product is less than the quantity of + the alert quantity defined in the settings, the kanban view + of the product will display a red background color. +

+ +
-
+
-
-

+

Point of Sale

- -

-
+
+
+

+ Enable the "Low Stock Alert for Individual Products"

+

+ Go to Settings --> Enable "Low Stock Alert for Individual + Products" button and enter the + Alert Quantity in the product form of each product. +

+ + +
+
+

+ List View

+

+ If the quantity of the product is less than the quantity of + the alert quantity defined in the product, the list view of + the product will display a red background color. +

+ +
+
+ +
+

+ Kanban View

+

+ If the quantity of the product is less than the + quantity of + the alert quantity defined in the product, the kanban + view + of the product will display a red background color. +

+ +
- +
+ +
+

+ Point of Sale

+

+ If the quantity of the product is less than the + quantity of + the alert quantity defined in the product, the pos + session + of the product will display an alert tag with + quantity. +

+ - -
-
- -
-

Related - Products -

-
-
-
-
- - -
-
- -
-

Our - Industries -

-
+ -
-
-
-
- -
- Trading -
-

- Easily procure - and - sell your products

-
-
+ -
-
- -
- POS -
-

- Easy - configuration - and convivial experience

-
-
+
+
+ +
+

+ Our Services +

+
-
-
- -
- Education -
-

- A platform for - educational management

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

-
-
+
+
+ +
+

+ Our + Industries +

+
-
-
- -
- Hotel Management -
-

- An - all-inclusive - hotel management application

-
-
-
-
+
+
+
+
+ +
+ 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

-
-
-
-
-
-
-
- + +
+
+ +
+

+ Support +

-
-

WhatsApp

-

Say hi to us on WhatsApp!

- -

+91 86068 - 27707

-
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions + or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us + on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
-
-
- -
-
-
\ No newline at end of file diff --git a/low_stocks_product_alert/views/product_product_views.xml b/low_stocks_product_alert/views/product_product_views.xml index 2fbcc3e85..9d5ffbe50 100644 --- a/low_stocks_product_alert/views/product_product_views.xml +++ b/low_stocks_product_alert/views/product_product_views.xml @@ -1,14 +1,19 @@ - + product.product.view.form.inherit.low.stocks.product.alert product.product - + - + + + + + diff --git a/low_stocks_product_alert/views/res_config_settings_views.xml b/low_stocks_product_alert/views/res_config_settings_views.xml index 06a75412e..e6d1b1678 100644 --- a/low_stocks_product_alert/views/res_config_settings_views.xml +++ b/low_stocks_product_alert/views/res_config_settings_views.xml @@ -15,8 +15,8 @@
- Low Stock Alert -
Quantity for Low Stock Alert + Low Stock Alert For All Products +
To set Alert for all products
@@ -26,6 +26,15 @@ class="oe_inline"/>
+
+
+ +
+
+ Low Stock Alert For Individual Products +
To set Alert for individual product +
+