Hi all
i added a many2many field on timesheet view which display all the project available on timesheet line.
this is the code :
project_ids = fields.Many2many('project.project', relation='timesheet_project_rel', string='Project',
compute='_get_default_project')
@api.depends('line_ids.project_id')
def _get_default_project(self):
project_ids = []
lst = []
for sheet in self:
for rec in sheet.line_ids:
project_ids.append(rec.project_id.id)
sheet.update({'project_ids': [(6, 0, project_ids)]})
and on xml :
<filter string="List Of project" name="groupby_project_ids" domain="[]"
context="{'group_by':'project_ids'}"/>
But i'm getting an error on filter of the list project because we can not group by many2many fields
Can any have another solution for help me ?
thanks in advance.