跳至内容
菜单
此问题已终结
1 回复
3536 查看

Hi,
am facing an issue while using project task and timesheet
i assigned task to an employee but while adding timesheet i have option for the selection of multiple employees
can i pass any domain for this.am using odoo 12 community

Thanks in advance

形象
丢弃
最佳答案

Hi,

can you try the code below

class TimesheetEmployee(models.Model):
    _inherit = 'account.analytic.line'

    @api.onchange('employee_id')
    @api.depends('employee_id')
    def _onchange_employee_id(self):
        for analytic in self:
            return {'domain':
                {
            'employee_id': [('user_id', '=', analytic.task_id.user_id.id)]}
                }

形象
丢弃
相关帖文 回复 查看 活动
1
10月 15
8166
0
8月 22
2107
3
7月 18
5188
0
3月 15
6585
1
6月 23
3322