2017-12-14 5 views
0

私はodoo 8.0を使用しており、私は資産リストのレポートを作成しています。これまでのところ私は、資産リストレポートを作成しました:
レポートをODOO 8の.pdf、.xls、または.csv形式でエクスポートする機能を備えたボタンを追加するにはどうすればよいですか?

enter image description here

私はどちらか.pdf.xlsまたは.csv形式としてレポートをエクスポートする機能を持つボタンを追加するにはどうすればよいですか?

ここには、レポートビュー用のスニペットコードがあります。その後

<record model="ir.actions.act_window" id="action_fleet_reporting_asset_listing"> 
    <field name="name">Asset Listing</field> 
    <field name="res_model">fleet.asset</field> 
    <field name="view_id" ref="fleet_asset_listing_report"></field> 
    <field name="view_type">tree</field> 
    <field name="view_mode">tree</field> 
    <field name="context">{"search_default_parent_false" : True,}</field> 
    <field name="help" type="html"> 
    <p> 
     Odoo helps you managing the costs for your different vehicles 
     Costs are generally created from services and contract and appears here. 
    </p> 
    <p> 
     Thanks to the different filters, Odoo can only print the effective 
     costs, sort them by type and by vehicle. 
    </p> 
    </field> 
</record> 

答えて

0
<report id="report_fleet_asset_list" 
    name="fleet.qweb_fleet_asset_list" 
    model="fleet.asset" 
    string="Assets" 
    report_type="qweb-pdf" /> 

は、テンプレートを作成しました:

<?xml version="1.0" encoding="utf-8"?> 
<!--Custom report.--> 

<openerp> 
    <data> 
     <template id="qweb_fleet_asset_list"> 
      <t t-call="report.html_container"> 
       <t t-call="report.internal_layout"> 
        <div class="page"> 
         <h2>Aseet List</h2> 
         <div class="row mt4 mb4" t-as="o" t-foreach="docs"> 
          <div class="col-md-6"> 
           <t t-esc="o.name"/> 
          </div> 
          <div class="col-md-6"> 
           <t t-esc="o.location" t-if="o.location"/> 
           <t t-if="not o.location">-</t> 
          </div> 
         </div> 
        </div> 
       </t> 
      </t> 
     </template> 
    </data> 
</openerp> 
関連する問題