跳至內容
選單
此問題已被標幟
1 回覆
2264 瀏覽次數

i had a list of employee then the create a ticket form request any parameter of this employee.

i create a button to generate a list of employee match the parameter.

how to show this list inside the same form below?

頭像
捨棄
作者

can i use ?
@py
employee_ids = fields.Many2many(
comodel_name='employee',
compute='_compute_employee',
string='employee Search Result',
)

@api.model
def _compute_employee(self):
employee_ids = self.env['employee'].search(
[
('active', '=', True),
])

self.employee_ids = [(6, 0, employee_ids)]

最佳答案

Hi,

Try assigning ids of "employee_ids" instead of its object, as follows: self.employee_ids = [(6, 0, employee_ids.ids)]


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
9月 22
1543
2
12月 23
1464
3
4月 25
7880
1
2月 24
1975
1
1月 24
1949