Browse Source

Jun 11 [UPDT] : Updated 'low_stocks_product_alert'

pull/320/head
AjmalCybro 12 months ago
parent
commit
e89d2b8ca8
  1. 6
      low_stocks_product_alert/doc/RELEASE_NOTES.md
  2. 10
      low_stocks_product_alert/models/product_product.py

6
low_stocks_product_alert/doc/RELEASE_NOTES.md

@ -3,5 +3,9 @@
#### 27.07.2023
#### Version 16.0.1.0.0
#### ADD
- Initial commit for Product Low Stock Alert
- Initial commit for Product Low Stock Alert
#### 10.06.2024
#### Version 16.0.1.0.1
##### BUGFIX
- Fixed the error in displaying the alert quantity for individual products

10
low_stocks_product_alert/models/product_product.py

@ -43,6 +43,7 @@ class ProductProduct(models.Model):
'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.',
compute="_compute_is_low_stock_alert"
)
min_low_stock_alert = fields.Integer(
string='Alert Quantity',
@ -66,3 +67,12 @@ class ProductProduct(models.Model):
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
@api.depends_context('is_low_stock_alert_individual')
def _compute_is_low_stock_alert(self):
config_param = self.env['ir.config_parameter'].sudo()
is_low_stock_alert_individual = config_param.get_param(
'low_stocks_product_alert.is_low_stock_alert_individual')
for product in self:
product.is_low_stock_alert = bool(
is_low_stock_alert_individual)

Loading…
Cancel
Save