'returns a tuple made of the browse record of customer location and the browse record of supplier location'

@api.model
def _get_partner_locations(self):

    Location = self.env['stock.location']
    customer_loc = self.env.ref('stock.stock_location_customers', raise_if_not_found=False)
    supplier_loc = self.env.ref('stock.stock_location_suppliers', raise_if_not_found=False)
    if (not customer_loc):
        customer_loc = Location.search([('usage', '=', 'customer')], limit=1)
    if (not supplier_loc):
        supplier_loc = Location.search([('usage', '=', 'supplier')], limit=1)
    if ((not customer_loc) and (not supplier_loc)):
        raise UserError(_("Can't    find    any    customer    or    supplier    location."))
    return (customer_loc, supplier_loc)
