def METHOD_NAME(self):
    for rec in self:
        room_type = self.env["pms.room.type"].search(
            [
                ("product_id", "=", rec.id),
            ]
        )
        if room_type:
            if len(room_type) > 1:
                raise ValidationError(
                    _("More than one room found for the same product")
                )
            rec.room_type_id = room_type
        else:
            rec.room_type_id = False