0
如何以excel格式顯示odoo 9.0中多個記錄的報告?在odoo中顯示excel表格9
在下面的代碼中,它只顯示一條記錄,但我想顯示多條記錄。 Python代碼: -
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
sheet = workbook.add_worksheet("timesheet")
bold = workbook.add_format({'bold': True})
sheet.write(1,1, obj.employee_id.name)
for line in obj.timesheet_ids:
bold = workbook.add_format({'bold': True})
sheet.write(1,2, line.date)
sheet.write(1,3, line.account_id.name)
sheet.write(1,4 , line.name)
sheet.write(1,5, line.unit_amount)
XML code:-
<data>
<openerp>
<report
id="partner_xlsx"
model="hr_timesheet_sheet.sheet"
string="Timesheet Report"
report_type="xlsx"
name="hr_timesheet_sheet.sheet.xlsx"
file="hr_timesheet_sheet.sheet.xlsx"
attachment_use="False"
/>
</openerp>
</data>
所以,我可以解決這個問題。我可以得到一些幫助在此問題,請``