1

I'm customizing Project's pivot view to show timesheet description along with task's name.

here is my code below but when I click pivot view it shows an error

<!-- Insert Project Issue Pivot Field -->
<record id="project_task_custom_pivot" model="ir.ui.view">
    <field name="name">project.task.custom.pivot</field>
    <field name="model">project.task</field>
    <field name="inherit_id" ref="project.view_project_task_pivot"/>
    <field name="arch" type="xml">
        <field name="stage_id" position="after">
            <field name="name" type="row"/>
            <field name="timesheet_ids" type="row"/>
        </field>
    </field>
</record>

Error below

assert groupby_def and groupby_def._classic_write, "Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True"

Edit

I re-defined the field "timesheet_ids" as @George Daramouskas mentioned.

timesheet_ids = fields.One2many('account.analytic.line', 'task_id', string="Timesheetss", store=True)

But It didn't work. So I took a look at the source code in Odoo Source

The function "One2many" has no such a parameter.

I guess the Store=True is for only regular field not related field.

Is there any other solution for this?

Thanks

Eric Lee
  • 700
  • 2
  • 9
  • 30

1 Answers1

0

Create your field with the attribute store=True in the constructor so that the field is stored in the database.

George Daramouskas
  • 3,720
  • 3
  • 22
  • 51