0
メインフォームビューで「最終結果」というボタンを作成しましたので、新しいレポートビューを開いてその結果を印刷します。odooのボタンをクリックして新しいレポートビューを開く10
メインフォームビューで「最終結果」というボタンを作成しましたので、新しいレポートビューを開いてその結果を印刷します。odooのボタンをクリックして新しいレポートビューを開く10
def print_report(self, cr, uid, ids, context=None):
active_id = context.get('active_id', [])
datas = {'ids' : [active_id]}
return {
'type': 'ir.actions.report.xml',
'report_name': 'pos.receipt', # mention your report name here
'datas': datas,
}
、それは非常に単純です。あなたのビューで :あなたのモデルで
<button name="generate_report" type="object" string="Generate report"/>
:
@api.multi
def generate_report(self):
return {
'type': 'ir.actions.report.xml',
'report_name': 'myModule.my_report'
}