fix: Don't delete portal items without reference doctype [backport/v4-fix]

Backport of !2289 (merged)


Merge request reports

Loading