# Custom Report Generation

**URL:** <https://discuss.tryton.org/t/custom-report-generation/8511>\
**Category:** Developer\
**Created:** [April 23, 2025, 9:00am UTC](https://discuss.tryton.org/t/custom-report-generation/8511 "2025-04-23T09:00:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bromoapp](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bromoapp](https://discuss.tryton.org/u/bromoapp)\
**Post date:** [April 23, 2025, 9:00am UTC](https://discuss.tryton.org/t/custom-report-generation/8511/1 "2025-04-23T09:00:43Z")

</div>

Hi, I have 2 models that one2many

[Parent]

```auto
class UserTimesheet(ModelSQL, ModelView):
    "User Timesheet"
    __name__ = 'afx.user.timesheet'

    year = fields.Selection([], "Year", help='Format: YYYY', required=True, states={
        'readonly': Eval('id', -1) > 0
    }, depends=['id'])
    month = fields.Selection([], "Month", sort=False, required=True, states={
        'readonly': Eval('id', -1) > 0
    }, depends=['id'])
    user = fields.Many2One('company.employee', "User", required=True, domain=[
        ('company', '=', MAIN_COMPANY)])

    records = fields.One2Many('afx.user.timesheet.record', 'timesheet', "Records", required=False)

```

[Child]

```auto
class UserTimesheetRecord(ModelSQL, ModelView):
    "Timesheet Record"
    __name__ = 'afx.user.timesheet.record'

    # unique_id field is to map between this record to its related ProjectTask record
    unique_id = fields.Char("Uuid")
    timesheet = fields.Many2One('afx.user.timesheet', "Timesheet")
    date = fields.Date("Date", required=True, states={
        'readonly': Eval('id', -1) > 0
    }, depends=['id'])
    day = fields.Selection([], "Day")
    task = fields.Selection([], "Status", sort=False)
    project = fields.Many2One('afx.project', "Project", domain=[
        ('so_no', '!=', None)
    ])
    detail = fields.Text("Detail")
    so_no = fields.Char("S/O Number")
    time_in = fields.Time("Time In")
    time_out = fields.Time('Time Out')
    total = fields.Float('Total Hours')

```

I am required to create report based on below layout, with the top yellow box come from parent model, and below are the list of child models.

 ![report-wanted](https://discuss-cdn.tryton.org/uploads/default/original/2X/2/2ea4d926f550ddb7ed59fbcda6b851874261e23f.jpeg)

Is this possible in trytond using aggregate model? or should I seek for custom library?

Meanwhile, when I use built-in report builder from Tryton, I can only produce as below screenshot:

 ![report-default](https://discuss-cdn.tryton.org/uploads/default/original/2X/0/096e899894e295fd5c411420b6d9dd021ed28202.jpeg)

Regards  
Bromo

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [April 23, 2025, 10:10am UTC](https://discuss.tryton.org/t/custom-report-generation/8511/2 "2025-04-23T10:10:44Z")

</div>

> [@bromoapp](#):
>
> Is this possible in trytond using aggregate model?

You can [define aggregated model](https://docs.tryton.org/latest/server/tutorial/module/table_query.html).
