Asegura el depósito correcto de venta del cliente cuando quita stock del warehous Depósitos.
Antes podía quitar stock de otros almacenes si se queda en negativo.
This commit is contained in:
parent
739250c64f
commit
5fa23f8d26
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ class Picking(models.Model):
|
||||||
super(Picking, self).onchange_picking_type()
|
super(Picking, self).onchange_picking_type()
|
||||||
if self.picking_type_id.is_deposit and self.partner_id:
|
if self.picking_type_id.is_deposit and self.partner_id:
|
||||||
self.change_dest_location()
|
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):
|
def change_dest_location(self):
|
||||||
if self.picking_type_id.code == 'internal':
|
if self.picking_type_id.code == 'internal':
|
||||||
|
|
Loading…
Add table
Reference in a new issue