Skip to Content
Menu
This question has been flagged
3 Replies
5874 Views

 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>


Avatar
Discard
Best Answer

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>
Avatar
Discard
Author Best Answer

The button does not still displayed.

Avatar
Discard
Best Answer

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,

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 24
19
1
Dec 24
48
1
Dec 24
69
0
Dec 24
38
1
Dec 24
64