I'd like them to follow the general instructions found there for creating a simple columnar data dump of timesheet data with the following columns.
- task name
- task date
- project name
- employee name
- hours
- a single week's timesheet is selected
- for a specified user
- from within the time-tracking module.
I want to print timesheet ids in excel which has one to many relationship.
Here is my .py code
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
class PartnerXlsx(ReportXlsx):
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
report_name = obj.employee_id.name
report_name = obj.timesheet_ids.date
report_name = obj.timesheet_ids.name
report_name = obj.timesheet_ids.hours
# One sheet by partner
sheet = workbook.add_worksheet(report_name[:31])
bold = workbook.add_format({'bold': True})
sheet.write('A1', 'Task Name', bold)
sheet.write('B1', 'Task Date', bold)
sheet.write('C1', 'Project Name', bold)
sheet.write('D1', 'Employee Name', bold)
sheet.write('E1', 'Hours', bold)
sheet.write(1, 1, obj.timesheet_ids.date[0], bold)
sheet.write(1, 0, obj.timesheet_ids.name, bold)
sheet.write(1, 4, obj.timesheet_ids.hours, bold)
sheet.write(1, 3, obj.employee_id.name, bold)
PartnerXlsx('report.hr_timesheet_sheet.sheet.xlsx',
'hr_timesheet_sheet.sheet')
Xml Code is
<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>
Please help me
Hello you get any solution related to this problem ?