2016-08-18 14 views
0

を、私はボタンを追加しようとしている「印刷XLS」カスタムモジュールを使用してアカウントの一般的なレポートでは、私は以下のように account_report_common_view.xml に直接ボタンを追加することができます、カスタムモジュールを使用してアカウント共通レポートにボタンを追加 - Odoo

<record id="account_common_report_view" model="ir.ui.view"> 
     <field name="name">Common Report</field> 
     <field name="model">account.common.report</field> 
     <field name="arch" type="xml"> 
     <form string="Report Options"> 
      <field name="company_id" invisible="1"/> 
      <group col="4"> 
       <field name="target_move" widget="radio"/> 
       <field name="date_from"/> 
       <field name="date_to"/> 
      </group> 
      <group col="3"> 
       <field name="journal_ids" widget="many2many_tags" options="{'no_create': True}"/> 
      </group> 
      <footer> 
       <button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> 
       or 
       <button name="check_report_xlsx" string="Print XLS" type="object" default_focus="1" class="oe_highlight"/> -- ADDED HERE 
       or 
       <button string="Cancel" class="oe_link" special="cancel" /> 
      </footer> 
     </form> 
     </field> 
    </record> 

これをカスタムモジュールで行いたいと思います。このボタンを新しいカスタムモジュールに追加するにはどうすればよいですか?あなたはそれを継承し、かつ、istanceのために、ボタンを追加することができますビューを変更するには https://www.odoo.com/documentation/9.0/howtos/backend.html

:あなたは、このガイドに従うことができ、モジュールを作成するには

答えて

0

。 この新記録、モデル=「ir.ui.view」内部:

<record id="your_name" model="ir.ui.view"> 
     <field name="name"> A name</field> 
<field name="model">account.common.report</field> 
     <field name="inherit_id" ref="account.account_common_report_view"/> 
     <field name="arch" type="xml"> 
      <data> 
       <!-- new tab added  --> 
       <xpath expr="//notebook/page" position="after"> 

あなたのモジュール(典型的なビュー/ account_report_common_view_button.xml)のディレクトリ内のビューを追加していることを確認してください とそれを追加[ "ビュー/ account_report_common_view_button.xml"、 ]

アンドレア

:マニフェスト データ
関連する問題