summaryrefslogtreecommitdiff
path: root/addons/stock/static/src/xml/forecast_widget.xml
diff options
context:
space:
mode:
authorRémy Voet (ryv) <ryv@odoo.com>2020-10-15 15:22:03 +0000
committerRémy Voet (ryv) <ryv@odoo.com>2020-10-16 12:56:56 +0000
commita1285d16ff32fb31f202ebe01a6afa83e14b9c14 (patch)
tree450b0c41c6d5a469e621a09bf6a6f5fcbc5cf64b /addons/stock/static/src/xml/forecast_widget.xml
parent5eed28cf927bc504b103cc872712ab0e49830a38 (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/xml/forecast_widget.xml')
-rw-r--r--addons/stock/static/src/xml/forecast_widget.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/static/src/xml/forecast_widget.xml b/addons/stock/static/src/xml/forecast_widget.xml
index 8d282da2452..463e14d6cb7 100644
--- a/addons/stock/static/src/xml/forecast_widget.xml
+++ b/addons/stock/static/src/xml/forecast_widget.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="stock.forecastWidget">
- <span t-if="['draft', 'partially_available', 'assigned'].includes(state)" t-esc="reserved_availability_str"/>
+ <span t-if="['draft', 'partially_available', 'assigned', 'cancel', 'done'].includes(state)" t-esc="reserved_availability_str"/>
<span t-elif="!forecast_expected_date_str and will_be_fulfilled" class="text-success">Available</span>
<span t-elif="forecast_expected_date_str and will_be_fulfilled" t-att-class="forecast_is_late ? 'text-danger' : 'text-warning'">Exp <t t-esc="forecast_expected_date_str"/></span>
<span t-else="" class="text-danger">Not Available</span>
- <button t-if="product_type == 'product'" class="o_forecast_report_button btn btn-link o_icon_button ml-2" title="Forecasted Report">
+ <button t-if="product_type == 'product'" t-att="id ? {} : {'disabled': ''}" class="o_forecast_report_button btn btn-link o_icon_button ml-2" title="Forecasted Report">
<i t-attf-class="fa fa-fw fa-area-chart {{ state != 'draft' and (!will_be_fulfilled or forecast_is_late) ? 'text-danger' : '' }}"/>
</button>
</t>