Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3618 Представления

I have a custom module with one2many field:

'worksheet_ids' : fields.one2many('ng.worksheet', 'machine_id', 'Munkalapok'),`

and i have both machine_id field on my current model and the ng.worksheet model.
I want to list in the form vew all the ng.worksheet that has that machine_id. But for somereason it lists wrong ones! I don't get it why, so i tried to add those existing records to the instance when i create it.

vals['worksheet_ids'] = [(6,0, worksheet_ids]

this sadly doesnt works ona newly created instance, and i get an error.

vals['worksheet_ids'] = [(4, worksheet_ids[0])]

this gives me that machine_id isn't set, when in the actual instance it is set.

So how can I do this? What am I doing wrong?

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
янв. 25
1817
1
авг. 24
2014
2
сент. 22
9547
2
апр. 22
4596
0
июл. 21
7247