From 5fa23f8d26672bbea8ab4cd0b58d601f252261e1 Mon Sep 17 00:00:00 2001 From: santiky Date: Wed, 15 Sep 2021 19:40:01 +0200 Subject: [PATCH] =?UTF-8?q?Asegura=20el=20dep=C3=B3sito=20correcto=20de=20?= =?UTF-8?q?venta=20del=20cliente=20cuando=20quita=20stock=20del=20warehous?= =?UTF-8?q?=20Dep=C3=B3sitos.=20Antes=20pod=C3=ADa=20quitar=20stock=20de?= =?UTF-8?q?=20otros=20almacenes=20si=20se=20queda=20en=20negativo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stock_picking_deposito/models/stock_picking.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stock_picking_deposito/models/stock_picking.py b/stock_picking_deposito/models/stock_picking.py index 0bcae08..1882dd8 100644 --- a/stock_picking_deposito/models/stock_picking.py +++ b/stock_picking_deposito/models/stock_picking.py @@ -25,6 +25,10 @@ class Picking(models.Model): super(Picking, self).onchange_picking_type() if self.picking_type_id.is_deposit and self.partner_id: self.change_dest_location() + if self.partner_id and self.location_id == self.env.ref("stock_picking_deposito.stock_location_deposits_stock"): + self.update({ + 'location_id': self.partner_id.deposit_sale_location_id.id, + }) def change_dest_location(self): if self.picking_type_id.code == 'internal':