[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
This commit is contained in:
Tiffany Chang (tic)
2023-05-10 16:36:59 +02:00
parent 0a74e47af9
commit 5dbd6e69b4
@@ -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() {