diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2020-10-15 15:22:03 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2020-10-16 12:56:56 +0000 |
| commit | a1285d16ff32fb31f202ebe01a6afa83e14b9c14 (patch) | |
| tree | 450b0c41c6d5a469e621a09bf6a6f5fcbc5cf64b /addons/stock/static/src/js/forecast_widget.js | |
| parent | 5eed28cf927bc504b103cc872712ab0e49830a38 (diff) | |
[FIX] stock: disabled forecasted button new line
In One2many tree of stock.move, the forecasted button trigger
a traceback in case of new line because there isn't a target record.
Also, don't show forecasted information when the state of the move
is 'cancel'.
Diffstat (limited to 'addons/stock/static/src/js/forecast_widget.js')
| -rw-r--r-- | addons/stock/static/src/js/forecast_widget.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/stock/static/src/js/forecast_widget.js b/addons/stock/static/src/js/forecast_widget.js index 3bfc490b2b6..d6d848f2566 100644 --- a/addons/stock/static/src/js/forecast_widget.js +++ b/addons/stock/static/src/js/forecast_widget.js @@ -53,6 +53,9 @@ const ForecastWidgetField = AbstractField.extend({ _onOpenReport: function (ev) { ev.preventDefault(); ev.stopPropagation(); + if (!this.recordData.id) { + return; + } this._rpc({ model: 'stock.move', method: 'action_product_forecast_report', |
