[FIX] point_of_sale: Ensure order exists before reading state in refund
Prior to this commit, there were scenarios where sync orders did not contain an order, leading to a failure when reading its state. This commit introduces a check to ensure the order exists in sync before its state is read, thereby preventing this error. opw-3856451 closes odoo/odoo#162943 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -276,7 +276,7 @@ export class TicketScreen extends Component {
|
||||
|
||||
const invoicedOrderIds = new Set(
|
||||
allToRefundDetails
|
||||
.filter(detail => this._state.syncedOrders.cache[detail.orderline.orderBackendId].state === "invoiced")
|
||||
.filter(detail => this._state.syncedOrders.cache[detail.orderline.orderBackendId]?.state === "invoiced")
|
||||
.map(detail => detail.orderline.orderBackendId)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user