'Create a transit location with company_id being the given company_id. This is needed
in case of resuply routes between warehouses belonging to the same company, because
we don\'t want to create accounting entries at that time.'

@api.one
def create_transit_location(self):

    parent_location = self.env.ref('stock.stock_location_locations', raise_if_not_found=False)
    location = self.env['stock.location'].create({'name': (_('%s:    Transit    Location') % self.name), 'usage': 'transit', 'location_id': ((parent_location and parent_location.id) or False)})
    location.sudo().write({'company_id': self.id})
    self.write({'internal_transit_location_id': location.id})
