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

Hey i have a many2many field in which i want to append the ids of all my lines in the wizard on clicking create vendor bill button but when i append it and pass value to the field i get only one out of my 2 ids as it is overwriting, here is my code

for rec in self.shipment_service:
print(rec)
service_val = {
rec.service_id.id
}
service.append((6,0,service_val))
This gives me all the ids in my lines and i store it in a list  then i am passing it like

invoice_vals = {
'service_id': (4,service)
}

whatever it try doesnt seem to work and it keep on overwriting


Аватар
Отменить
Автор
Hey Farid!
Thanks for replying on my question but i dont know whats wrong with my post and i am unable to pop it as its giving internal server error, can you kindly send what you wrote as an answer here on email. I shall be thankful.

On Wed, 15 Sept 2021 at 18:05, Farid Ghanchi <gfarid89@gmail.com> wrote:

A new answer on Odoo Many2many tag append issue from list has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

Лучший ответ

this is code just used below line
service_id = [(6,0,self.shipment_service.mapped('service_id').ids)]
Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 18
3360
0
янв. 16
3376
1
июн. 15
13542
4
мар. 15
33099
1
мар. 15
4586