Skip to content

Commit

Permalink
Merge PR #1798 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by alexis-via
  • Loading branch information
OCA-git-bot committed Dec 19, 2024
2 parents 841e1a9 + 93d645f commit a7e336c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions product_expiry_simple/models/stock_production_lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.tools.misc import format_date


class StockProductionLot(models.Model):
_inherit = "stock.production.lot"

expiry_date = fields.Date(string="Expiry Date")
expiry_date = fields.Date(string="Expiry Date", tracking=True)
expired = fields.Boolean(compute="_compute_expired")

def _compute_expired(self):
Expand All @@ -30,7 +30,7 @@ def name_get(self):
if lot.expiry_date:
expiry_date_print = format_date(self.env, lot.expiry_date)
if lot.expiry_date < today:
dname = _("[%s Expired] %s") % (expiry_date_print, dname)
dname = f"[{expiry_date_print} ⚠] {dname}"
else:
dname = "[%s] %s" % (expiry_date_print, dname)
res.append((lot.id, dname))
Expand Down

0 comments on commit a7e336c

Please sign in to comment.