Skip to content

Commit 3422ac2

Browse files
committed
fix 63905
1 parent aa3e4d4 commit 3422ac2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,7 +4213,12 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry<ReportAction>
42134213
}
42144214

42154215
if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.REPORT) {
4216+
const isRequestIOU = isIOUReport(moneyRequestReport);
4217+
if (isRequestIOU) {
4218+
return false;
4219+
}
42164220
const isOwner = moneyRequestReport?.ownerAccountID === currentUserAccountID;
4221+
42174222
// Unreported transaction from OldDot can have the reportID as an empty string
42184223
const isUnreported = !transaction?.reportID || transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
42194224
return isUnreported

src/pages/iou/request/step/IOURequestEditReportCommon.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
1111
import useDebouncedState from '@hooks/useDebouncedState';
1212
import useLocalize from '@hooks/useLocalize';
1313
import Navigation from '@libs/Navigation/Navigation';
14-
import {getOutstandingReportsForUser, getPolicyName} from '@libs/ReportUtils';
14+
import {getOutstandingReportsForUser, getPolicyName, isIOUReport} from '@libs/ReportUtils';
1515
import CONST from '@src/CONST';
1616
import ONYXKEYS from '@src/ONYXKEYS';
1717
import type {Route} from '@src/ROUTES';
@@ -59,6 +59,7 @@ function IOURequestEditReportCommon({backTo, transactionsReports, selectReport,
5959

6060
const onlyReport = transactionsReports.length === 1 ? transactionsReports.at(0) : undefined;
6161
const isOwner = onlyReport ? onlyReport.ownerAccountID === currentUserPersonalDetails.accountID : false;
62+
const isReportIOU = onlyReport ? isIOUReport(onlyReport) : false;
6263

6364
const expenseReports = useMemo(
6465
() =>
@@ -123,7 +124,7 @@ function IOURequestEditReportCommon({backTo, transactionsReports, selectReport,
123124
initiallyFocusedOptionKey={transactionsReports.length === 1 ? transactionsReports.at(0)?.reportID : undefined}
124125
ListItem={InviteMemberListItem}
125126
listFooterContent={
126-
isEditing && isOwner ? (
127+
isEditing && isOwner && !isReportIOU ? (
127128
<MenuItem
128129
onPress={removeFromReport}
129130
title={translate('iou.removeFromReport')}

0 commit comments

Comments
 (0)