def METHOD_NAME(self):
    fsm_orders = self.mapped("fsm_order_ids")
    action = self.env["ir.actions.act_window"]._for_xml_id(
        "fieldservice.action_fsm_dash_order"
    )
    if len(fsm_orders) > 1:
        action["domain"] = [("id", "in", fsm_orders.ids)]
    elif len(fsm_orders) == 1:
        action["views"] = [(self.env.ref("fieldservice.fsm_order_form").id, "form")]
        action["res_id"] = fsm_orders.id
    else:
        action = {"type": "ir.actions.act_window_close"}
    return action