コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POS店舗
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 承認
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具専門店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • 醸造所
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    製品デモを利用する
  • 料金
  • ヘルプ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • 会計
  • 在庫
  • PoS
  • プロジェクト
  • MRP
All apps
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

(Odoo v11) Print button on website to print the report in pdf.

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
pdfreportingv11websiteodoo
7 返信
10769 ビュー
アバター
Abdullah

i have a purchase comparison chart which matches the Bids amount . It shows the comparison in odoo website but client also want to save that report. I find no way of downloading that report. I am thinking of a button on the website screen which can the download the report. I need some guidance Please help  

0
アバター
破棄
アバター
Nikhil kushwaha
最善の回答

XML 

<a t-att-href="/report/new/">
  <button type="button" class="btn btn-primary btn-md ">Print Report</button>
</a>

Python 


@http.route('/report/new/', methods=['POST', 'GET'], csrf=False, type='http', auth="user", website=True)
def print_id(self, **kw):
    pdf, _ = request.env.ref('Model_Name.Action_Name')\.sudo().render_qweb_pdf([int(purchase_id)])
    pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf)),('Content-Disposition', 'catalogue' + '.pdf;')]
    return request.make_response(pdf, headers=pdfhttpheaders)



0
アバター
破棄
Abdullah
著作者

hey thanks for replying. one question, you are using purchase_id for?

アバター
Cybrosys Techno Solutions Pvt.Ltd
最善の回答

Hi,

Follow the steps below

create a button:(xml)

<a t-attf-href="'/report/type_of_the_report/module_name.template_name/%s' % id">
    <button type="button" class="btn btn-primary btn-md o_website_form_send">Print Report</button>
</a>

in controller:(py)

@http.route('your custom route', methods=['POST', 'GET'], csrf=False, type='http', auth="user", website=True)
def print_id(self, **kw):
record_id = kw['rec_id']
if record_id:
pdf = request.env['report'].sudo().get_pdf([record_id], 'module_name.report_name', data=None)
pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
return request.make_response(pdf, headers=pdfhttpheaders)
else:
return request.redirect('/')
3
アバター
破棄
Abdullah
著作者

Thank you so much for replying!

when i follow the above line of code and press the button it takes me to another page and says "404 page not found".

I have 3 confusions if you can please help

1) should i create another class in the controller for the above http.route?As i already have a class with a route which displays my report.

2)For web reports , do we have to set it up same like pdf reports? like the following

<report

id="account_invoices"

model="account.invoice"

string="Invoices"

report_type="qweb-pdf"

name="account.report_invoice"

file="account.report_invoice"

attachment_use="True"

attachment="(object.state in ('open','paid')) and

('INV'+(object.number or '').replace('/','')+'.pdf')"

/>

3) On what basis we define a route? shoould it be same of the button path?

It will be very helpful if you could just explain as its my first time working with controller. i'll be very thankful!

Cybrosys Techno Solutions Pvt.Ltd

You can refer the following module for the clarification in which we are added the option for printing the pdf catalogue of a product from the website

https://www.odoo.com/apps/modules/12.0/product_catalogue/

Abdullah
著作者

ok thanks :)

Abdullah
著作者

That download catelogue button in your module is not working giving internal server error and this is what i have in the log

AttributeError: 'report.product_catalogue.report_product_catalog' object has no attribute 'get_report_values'

Cybrosys Techno Solutions Pvt.Ltd

This module is available for odoo 12, i think you are trying to install this module on odoo v11

ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

今すぐアカウントを作成して、限定機能を利用したり、素晴らしいコミュニティと交流しましょう!

登録
関連投稿 返信 ビュー 活動
odoov11 what is the use of window.print(). 解決済
function reporting v11 website odoo
アバター
アバター
1
11月 19
3847
Odoo qweb report download on odoo website using a button 解決済
reporting website odoo
アバター
アバター
2
10月 17
14102
How to assign a url to a download button on odoo website(v11) 解決済
purchase pdf reporting url website
アバター
アバター
1
8月 22
7081
How to create pdf report from website frontend? 解決済
pdf form reporting website v14
アバター
アバター
2
9月 21
7987
Odoo website iframe youtube video not showing
website odoo
アバター
1
11月 25
3325
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • Github
  • Runbot
  • 翻訳
サービス
  • Odoo.shホスティング
  • サポート
  • アップグレード
  • カスタム開発
  • 教育プログラム
  • 会計事務所一覧
  • パートナー一覧
  • パートナーになる
企業情報
  • 会社概要
  • ブランドアセット
  • お問い合わせ
  • 採用情報
  • イベント
  • ポッドキャスト
  • ブログ
  • お客様一覧
  • リーガル情報 • プライバシーポリシー
  • セキュリティ
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo(オドゥー)は、CRM、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now