Skip to Content
Menú
This question has been flagged
3628 Vistes

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?

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
d’oct. 22
2063
2
d’abr. 25
6438
1
de juny 22
5312
1
de març 19
3394
2
de gen. 19
30823