diff --git a/addons/stock/static/src/stock_forecasted/stock_forecasted.js b/addons/stock/static/src/stock_forecasted/stock_forecasted.js index 6a8d0b307b8..7eed0c255f5 100644 --- a/addons/stock/static/src/stock_forecasted/stock_forecasted.js +++ b/addons/stock/static/src/stock_forecasted/stock_forecasted.js @@ -1,6 +1,7 @@ /** @odoo-module **/ import { useService } from "@web/core/utils/hooks"; +import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; import { View } from "@web/views/view"; import { ControlPanel } from "@web/search/control_panel/control_panel"; @@ -20,7 +21,11 @@ export class StockForecasted extends Component { this.context = useState(this.props.action.context); this.productId = this.context.active_id; this.resModel = this.context.active_model; - this.title = this.props.action.name; + this.title = this.props.action.name || _t("Forecasted Report"); + if(!this.context.active_id){ + this.context.active_id = this.props.action.params.active_id; + this.reloadReport(); + } onWillStart(this._getReportValues); }