我试图在Odoo v12中创建一个用于打印多个qweb报告的按钮。 我正在使用一些函数来获取每个记录数据,并使用一个主要函数来调用所有其他函数。
在主函数中返回一个报告时,记录将正确打印,但是当我尝试返回多个nothin时,会发生记录。
这是用于获取数据(报告)的python类:
class SaleOrderReport(models.Model):
_inherit = 'sale.order'
@api.multi
def action_print_reports(self):
d1 = self.print_sale_report()
d2 = self.print_sale_report2()
d3 = self.print_sale_report2()
d4 = self.print_sale_report3()
d5 = self.print_sale_report4()
d6 = self.print_sale_report5()
d7 = self.print_issue_report()
d8 = self.print_issue_report2()
return d1
def print_sale_report(self):
return self.env.ref('custom_v12_reports.sale_order_report').report_action(self)
def print_sale_report2(self):
return self.env.ref('custom_v12_reports.sale_order_report2').report_action(self)
def print_sale_report3(self):
return self.env.ref('custom_v12_reports.sale_order_report3').report_action(self)
def print_sale_report4(self):
return self.env.ref('custom_v12_reports.sale_order_report4').report_action(self)
def print_sale_report5(self):
return self.env.ref('custom_v12_reports.sale_order_report5').report_action(self)
def print_issue_report(self):
return self.env.ref('custom_v12_reports.school_issue_report').report_action(self)
def print_issue_report2(self):
return self.env.ref('custom_v12_reports.school_issue_report2').report_action(self)
有人知道发生了什么吗? 可以一次打印这些记录吗?
感谢阅读。