in xml :
<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"> <group col="4"> <header> <button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> <button string="Cancel" class="btn btn-secondary" /> </header> </form> </field> </record>
python : call every things call
def check_report(self): self.ensure_one() data = {} data['ids'] = self.env.context.get('active_ids', []) data['model'] = self.env.context.get('active_model', 'ir.ui.menu') data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0] used_context = self._build_contexts(data) data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code) return self.with_context(discard_logo_check=True)._print_report(data)