Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7016 Lượt xem

 Hello, I'm still new in odoo 10.
I was trying to add a button beside Print button and Cancel button in a wizard of PDF Reports (submenus).
But it doesn't show up.

Here's my code:


<?xml version="1.0" encoding="utf-8"?>
<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="inherit_id" ref="account.account_common_report_view" />
        <field name="arch" type="xml">
                <xpath expr="//footer" position="inside">
                 <button name="export_to_xls" string="Export to .xls" type="object" class="oe_link"/>
                </xpath>          
        </field>
    </record>
</odoo>


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

hello,

try to inherit with particular model view like

here i inherit the general ledger report. so i need to pass the model name which i need to inherit.

 <record id="account_common_report_view" model="ir.ui.view">      
  <field name="name">Common Report</field>     
  <field name="model">account.report.general.ledger</field> 
<field name="inherit_id" ref="account.account_common_report_view" /> 
  <field name="arch" type="xml">   
<xpath expr="//footer" position="inside"> 
<button name="export_to_xls" string="Export to .xls" type="object" class="oe_link"/>     
          </xpath>     
      </field> 
  </record>
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

The button does not still displayed.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Kinah Guinto,

Try below code.

<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <!-- Inherit Account Common Form View -->
    <record id="account_common_report_form_view_inherit" model="ir.ui.view">
        <field name="name">account.common.report.form.view.inherit</field>
        <field name="model">account.common.report</field>
        <field name="inherit_id" ref="account.account_common_report_view"/>
        <field name="arch" type="xml">
            <xpath expr="//form/footer/button[@name='check_report']" position="after">
                <button name="export_to_xls" string="Export to .xls" type="object" class="oe_highlight"/>
                or
            </xpath>
        </field>
    </record>

</odoo>


Hope it will works for you.

Thanks,

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 25
82
1
thg 8 25
258
0
thg 8 25
190
2
thg 8 25
201
2
thg 8 25
775