Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Python3: How to get the article information of a fabrication order

Avatar
odoo
Avatar
Discard
2 Answers
0
Avatar
odoo
Best Answer

Hi Corentin MAUDET

You can get the article information on the "components" tab like this.

for mo in mo_list:
move_raw_ids = mo.get('move_raw_ids',[])
move_raw = models.execute_kw(self.mErpDB,self.mUserId,self.mErpPwd,'stock.move','search_read',[[('id','in',move_raw_ids)]],{'fields':['product_id']})
print('\n move_raw',move_raw)

Avatar
Discard
0
Avatar
odoo
Best Answer

Hello

It works, thanks a lot!!

I have another question, now i get that:

move_raw=====> [{'id': 26, 'product_id': [6, 'Palette3 1200x800']}, {'id': 27, 'product_id': [7, 'Cartons4 57x45x45']}]


I use this code:

for mo_dico2 in move_raw:
    self.mListArticles.clear()
    for X in mo_dico2.keys():
        print(f'mo_dico2====>{mo_dico2}')
        self.mListOFArticle.append(mo_dico2[X])
self.mListArticles.append(self.mListOFArticle.copy())
And i get thas:
mo_dico2====>{'id': 26, 'product_id': [6, 'Palette3 1200x800']}

How can i just get 'Palette3 1200x800' ?

 

Thanks


Avatar
Discard