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

Hello. I am having trouble trying to add stock to a product in my Odoo using the API. Currently, I am trying to add it to the model "stock.quant" but does not work since it prints this message: "You cannot take products from or deliver products to a location of type "view" (Physical Locations).". I also have tried to use "stock.move.line" with "stock.picking" but since I have to specify source warehouse, I cannot do it. Thanks!

形象
丢弃
编写者

Thank you for your answer! It helped me a lot! I have to be sure that the location is internal. Thanks!

最佳答案

Hello Garber,

""You cannot take products from or deliver products to a location of type "view" (Physical Locations)."""

Above  validation error occur only, when we try to update stock for location which has usage="view". 

please apply following domain to select location for product on stock.quant to update stock. 

domain="[('usage', 'in', ['internal', 'transit'])]" 


Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat



形象
丢弃
相关帖文 回复 查看 活动
3
1月 23
7743
1
3月 22
5550
1
2月 22
5676
1
7月 20
9459
1
1月 24
3821