From 5dbd6e69b45e9a49daf9b9da57ebab0af48f4df2 Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Wed, 26 Apr 2023 14:20:14 +0000 Subject: [PATCH] [FIX] stock: disable reception "Assign All" when nothing to assign In the case of draft pickings/MOs, the reception_report_main component's "Assign All" button was NOT disabled, which could result in an IndexError if the button was pushed. Note that this issue does not occur for the "Assign All" button within a table because the button is correctly not shown at all when there are no assignable lines within it. Noticed during task: 3046178 X-original-commit: 403d1ba5839d6073ee6321e77863f928336158ba Part-of: odoo/odoo#120935 --- .../reception_report_main/stock_reception_report_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/static/src/components/reception_report_main/stock_reception_report_main.js b/addons/stock/static/src/components/reception_report_main/stock_reception_report_main.js index dd4816a1a7e..ba87ce877eb 100644 --- a/addons/stock/static/src/components/reception_report_main/stock_reception_report_main.js +++ b/addons/stock/static/src/components/reception_report_main/stock_reception_report_main.js @@ -133,7 +133,7 @@ export class ReceptionReportMain extends Component { } get isAssignAllDisabled() { - return Object.values(this.state.sourcesToLines).every(lines => lines.every(line => line.is_assigned)); + return Object.values(this.state.sourcesToLines).every(lines => lines.every(line => line.is_assigned || !line.is_qty_assignable)); } get isPrintLabelDisabled() {