Reputation: 271
I am working on printing report where report first download or directly press ctrl+hift+p to print. How can i add button which directly print report instead pressing ctrl+shift+p?
Upvotes: 2
Views: 3574
Reputation: 1524
Create a Button in form view.
<button type="object" name="print_report" />
On click of button call this method.
@api.multi
def print_report(self):
return self.env['report'].get_action(self,'MODULE_NAME.REPORT_NAME')
Make sure you are having a report with name="MODULE_NAME.REPORT_NAME"
.
Upvotes: 5