It is customary to conduct a festive celebration called a "Siyum" upon completing the study of a Masechet (Talmudic tractate). If a congregation prays Shaharit or Minha just before a Siyum celebration, do they omit the solemn Tahanunim prayers in honor of the festive occasion?
Hacham Ovadia Yosef addresses this question in his Yabia Omer (vol. 4, Siman 13), where he cites numerous sources that underscore the importance of the Siyum celebration and the especially festive nature of this event. The Gemara in Masechet Shabbat (118) cites Abayeh as exclaiming, "I will be rewarded, because when I see a Torah scholar who completes a Masechet, I make a feast for the Rabbis." Similarly, the Midrash (Shir Hashirim Rabba) states explicitly that a festive meal should be made to celebrate the completion of a section of Torah. The Yam Shel Shelomo (Rabbi Shlomo Luria, 1510-1573) goes so far as to say that in the Zimun preceding Birkat Hamazon after a Siyum, one should recite "She’ha’simha Bi’m’ono," just as one does at a wedding or Sheba Berachot celebration. Although Halacha does not follow this view – and the Yam Shel Shelomo himself later retracted this ruling – it certainly underscores the Halachic stature of the Siyum celebration. In fact, the Kaf Ha’haim (Rav Yaakob Haim Sofer, Baghdad-Israel, 1870-1939) ruled that when one recites Birkat Hamazon after a Siyum, he should recite "Migdol Yeshu’ot Malko," as we do on Shabbat and holidays, as opposed to the weekday version of "Magdil." Halacha indeed follows this ruling, demonstrating how the occasion of a Siyum is treated as a holiday.
Another source relevant to this issue is the Mishna in Masechet Ta’anit that discusses the festive nature of the 15th of Ab (Tu Be’Ab). One of the reasons why this day was celebrated as a festive occasion, the Gemara explains, is that the people would "break their axes," meaning, they would stop chopping wood for the altar. On this day, the people in charge of supplying wood to fuel the altar in the Bet Hamikdash completed their work for this important Misva, and this day was therefore observed as a holiday as sorts. (Even nowadays, Tahanunim are omitted on Tu Be’Ab.) This demonstrates the fact that the completion of a Misva warrants the observance of a holiday, and this certainly applies to the completion of the study of a Masechet. This celebration is valuable not only as an expression of honor to the Torah, but also as a source of inspiration and motivation for people to increase their study of Torah.
Accordingly, Hacham Ovadia ruled that if a group of people pray together just before a Siyum celebration, they can, and in fact should, omit Tahanunim in honor of the happy occasion. For example, if a Minyan assembles for Shaharit and will be celebrating a Siyum immediately following the service, they omit Tahanunim from Shaharit. If the Siyum is held in the afternoon, and the participants recite Minha just before the Siyum, then they would omit Tahanunim during Minha.
Summary: A group of people who pray Shaharit or Minha just before a Siyum celebration should omit Tahanunim from the prayer service.