diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index 15680ede..ff5b0c5a 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -30,13 +30,14 @@ import re import logging import six +import humanize import sqlalchemy as sa from rattail import pod from rattail.db import model, api, Session as RattailSession from rattail.db.util import maxlen from rattail.gpc import GPC -from rattail.time import localtime +from rattail.time import localtime, make_utc from rattail.util import pretty_quantity, prettify, OrderedDict from rattail.vendors.invoices import iter_invoice_parsers, require_invoice_parser from rattail.threads import Thread @@ -1561,7 +1562,9 @@ class ReceivingBatchView(PurchasingBatchView): default=False) if alert_received: if self.handler.get_units_confirmed(row): - self.request.session.flash("You have already received some of this product.", 'receiving-warning') + msg = "You have already received some of this product; last update was {}.".format( + humanize.naturaltime(make_utc() - row.modified)) + self.request.session.flash(msg, 'receiving-warning') return self.render_to_response('receive_row', context, mobile=True)