diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index f389f25ae75..12e61ab27ad 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -877,6 +877,10 @@ class StockQuant(models.Model): name = _('Product Quantity Confirmed') else: name = _('Product Quantity Updated') + + if self.inventory_date: + name += _(' [Scheduled on %s]', self.inventory_date) + return { 'name': self.env.context.get('inventory_name') or name, 'product_id': self.product_id.id, diff --git a/addons/stock_account/models/stock_quant.py b/addons/stock_account/models/stock_quant.py index affad430395..3cc0d524e84 100644 --- a/addons/stock_account/models/stock_quant.py +++ b/addons/stock_account/models/stock_quant.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models +from odoo import api, fields, models, _ from odoo.tools.float_utils import float_is_zero from odoo.tools.misc import groupby @@ -71,6 +71,14 @@ class StockQuant(models.Model): else: super(StockQuant, inventories)._apply_inventory() + def _get_inventory_move_values(self, qty, location_id, location_dest_id, out=False): + res_move = super()._get_inventory_move_values(qty, location_id, location_dest_id, out) + if not self.env.context.get('inventory_name'): + force_period_date = self.env.context.get('force_period_date', False) + if force_period_date: + res_move['name'] += _(' [Accounted on %s]', force_period_date) + return res_move + @api.model def _get_inventory_fields_write(self): """ Returns a list of fields user can edit when editing a quant in `inventory_mode`."""