跳至内容
菜单
此问题已终结
3790 查看

Hi, the module sale_stock adds warehouse_id into sale.order model,


After created stock.picking object and before delivery the load to a client (stock.picking.state = 'assigned', not 'done' yet) sometimes I need to change a warehouse.


Unfortunatelly warehouse_id in stock.picking, stock.move, stock.quant stays like at the beginning.


When I change the warehouse_id and location_id with the write method that does not affect the rest of the models:


picking_id = self.env['stock.picking'].search([('origin', '=', self.name)]).id

for stock_move in self.env['stock.move'].search([('picking_id', '=', picking_id)]):

stock_move.write({'warehouse_id': self.warehouse_id.id, 

              'location_id': self.warehouse_id.lot_stock_id.id})


Do I need to update all warehouse_id and location_id fields in all models manually?

Shouldn´t it have been all related and update automatically?

形象
丢弃
相关帖文 回复 查看 活动
0
10月 22
2220
2
4月 25
6746
1
6月 22
5640
1
3月 19
3509
2
1月 19
31036