def METHOD_NAME(doc):
    if doc.is_return and doc.is_debit_note:
        frappe.throw(
            _(
                "You have selected both 'Is Return' and 'Is Rate Adjustment Entry'. You can select only one of them."
            ),
            title=_("Invalid Options Selected"),
        )