Cambia el tipo de las ubicaciones de los depósitos de salida a tránsito para evitar que se calculen en las cantidades a mano.

This commit is contained in:
santiky 2021-09-25 15:51:38 +02:00
parent 82858796a4
commit 00e898069d
Signed by: snt
GPG key ID: A9FD34930EADBE71

View file

@ -43,13 +43,13 @@ class ResPartner(models.Model):
def create(self, vals): def create(self, vals):
if vals.get('deposit_sale_accept', False) == True: if vals.get('deposit_sale_accept', False) == True:
vals['deposit_sale_location_id'] = self.env['stock.location'].create({ vals['deposit_sale_location_id'] = self.env['stock.location'].create({
'usage': 'internal', 'usage': 'transit',
'name': vals.get('name'), 'name': vals.get('name'),
'location_id': self.env.ref('stock_picking_deposito.stock_location_deposits_stock').id 'location_id': self.env.ref('stock_picking_deposito.stock_location_deposits_stock').id
}).id }).id
if vals.get('deposit_buy_accept', False) == True: if vals.get('deposit_buy_accept', False) == True:
vals['deposit_buy_location_id'] = self.env['stock.location'].create({ vals['deposit_buy_location_id'] = self.env['stock.location'].create({
'usage': 'internal', 'usage': 'transit',
'name': vals.get('name'), 'name': vals.get('name'),
'location_id': self.env.ref('stock_picking_deposito.location_deposit_buy').id 'location_id': self.env.ref('stock_picking_deposito.location_deposit_buy').id
}).id }).id
@ -59,13 +59,13 @@ class ResPartner(models.Model):
def write(self, vals): def write(self, vals):
if ( vals.get('deposit_sale_accept', False) == True ) and not self.deposit_sale_location_id: if ( vals.get('deposit_sale_accept', False) == True ) and not self.deposit_sale_location_id:
vals['deposit_sale_location_id'] = self.env['stock.location'].create({ vals['deposit_sale_location_id'] = self.env['stock.location'].create({
'usage': 'internal', 'usage': 'transit',
'name': self.name, 'name': self.name,
'location_id': self.env.ref('stock_picking_deposito.stock_location_deposits_stock').id 'location_id': self.env.ref('stock_picking_deposito.stock_location_deposits_stock').id
}).id }).id
if ( vals.get('deposit_buy_accept', False) == True ) and not self.deposit_buy_location_id: if ( vals.get('deposit_buy_accept', False) == True ) and not self.deposit_buy_location_id:
vals['deposit_buy_location_id'] = self.env['stock.location'].create({ vals['deposit_buy_location_id'] = self.env['stock.location'].create({
'usage': 'internal', 'usage': 'transit',
'name': self.name, 'name': self.name,
'location_id': self.env.ref('stock_picking_deposito.location_deposit_buy').id 'location_id': self.env.ref('stock_picking_deposito.location_deposit_buy').id
}).id }).id